javascript

Are CSS styles applied to markup that is added after the page loads?

Hello. I'm learning Javascript and CSS and have run into an issue where my CSS styles aren't being applied to markup that I'm dynamically generated from XML and writing to document after the page has loaded. I can only assume that the styles aren't being applied because I'm modifying the document after it's already been loaded. Is thi...

javascript-how to open window (from hyperlink) and then close it with delay of 5 sec?

I am trying to open new window from hyperlink using java script and then auto close it in five seconds. It either closes right away or doesn't close at all. Here are some samples of code I was using: "function closeOnLoad(myLink){var newWindow=window.open(myLink);newWindow.onload=SetTimeout(newWindow.close(),5000);}" + LinkText + "" ...

Javascript : Change the function of the browser's back button

Is there a way to make the user's back button on their browser, call a javascript function instead of going back a page? ...

exlude item from handle on jquery draggable

i have a draggable div that has the overflow position to auto, so when the content is too big and i get a scroll bar, since i haven't added a handle (i want the hole content of the div to drag it) when you use de scroll bar the div moves/draggs.... is there a way of excluding an element from the handle of a draggable div in jquery? i...

How does one handle a Facebook Connect timeout

I don't see any way to respond to a timeout issue if Facebook is down or not responding when I use FB.init. There's no option here: http://wiki.developers.facebook.com/index.php/JS%5FAPI%5FM%5FFB.Bootstrap.Init%5F2 Would be nice if there were some way to respond to errors like you can with normal xmlhttprequests. Is there such a thing w...

Form that makes browser redirect when accessed by either a regular form submit or an Ajax request - is this possible?

I have a web page with a form. When the user submits the form, I want the server to make the browser redirect to a different page from the form action. Right now, I am doing this by using PHP's header function to send a 302 status code. It works fine. I am trying to make the page on the server redirect the browser in the same way, regar...

Figuring out which page is calling a piece of JavaScript, in PHP.

I have a PHP file that generates a JS file, that is being included on a number of sites. I'd like to be able to check which site the file is being included from on each request. I tried using $_SERVER['HTTP_REFERER'] in PHP, but that just returns the domain that the JS file is hosted on. Any ideas would be greatly appreciated. ...

django - using a common header with some dynamic elements.

I'm planning to create a website using django that will have a common header throughout the entire website. I've read django's documentation on templating inheritance, but I can't seem to find an elegant solution for the "dynamic" elements in my header. For example, the header in the website will include tabs, say similar to http://www...

Cookies on a remote site with IE

Hi all, We’re generating a video and pushing it to our client's web site. You can see it here, as an example: http://www.expresspassport.com/ We're calling the code by a remote JavaScript file that injects a few DOM elements. We're also setting a cookie to handle repeat visitors in a different behavior then new visitors. Up until a...

jQuery Treemap Plugin

Hello, I am trying to get the Treemap plugin (http://www.jquery.info/spip.php?article40) working with jQuery v1.3.x. The plugin works with jQuery v1.1 and v1.2 but for some reason it fails with the v1.3 base. This is the browser error "Error: uncaught exception: Syntax error, unrecognized expression: >" Does anyone know changes occurr...

What are the issues when adding Javascript Postback functions to an ASP.NET Web Application?

I'm maintaining an ASP.NET Web application that was originally created by an outsourcing firm but is now in-house. I've noticed that the previous Developers added several Javascript functions to the Master Page that seem to handle postback events. Here's a code sample - var isPostBackEvent=false; function ValidatePostBack() ...

Hooking all function calls in JavaScript?

My intuitive response to this question would be ,"This is so stupid that I can't continue having this conversation." However: Is there any way to hook all javascript function calls within my module? I'd like to find a convenient way of showing "loading blah...", "done..." messages when performing AJAX calls without having to explicitly ...

jQuery event bubbling: Get original element mouseover (for table row highlighting)

Hello, I'm trying to reduce my 'onmouseover' event listeners in my table (in which I highlight rows on hover). I want to do this by attaching an event listener to the entire table instead of each <tr> (that's how I have it now). The reason is that IE is reacting very slow and the only answer I found to this was to reduce the number of ev...

waiting for an iframe to load before passing information to it

Apologies if this is already answered elsewhere, but I've been searching all morning and not found a solution, so I'm hoping someone can help. So - from javascript I am opening an iframe righttop.location = "timesheet_notes.php"; and then wanting to pass information to it: righttop.document.notesform.ID_client.value = Client; Obvi...

Using Javascript back function after POST form submit

Hi, In my web application, I'm providing a link, clicking on which goes to another page, shows some data,popups a page and goes back using javascript back() function. It was working fine but it fails in certain cases. For example, this link appears after a form submission also. When the back() function is called here, the Webpage Expir...

Should I keep a copy in memory of the information being displayed?

I am building a webapp to edit some information from a database. The database is being displayed as a table with editing capabilities. When editing a value, generally I have to validate and do some other tasks, depending on the value that's being edited. Should I keep a copy as array of objects in memory and use their methods or should...

JavaScript Double Dollar Sign

I understand the use of the (single) dollar sign in popular JavaScript libraries such as jQuery and Prototype. I also understand the significance of the double dollar sign in PHP (variable variables). Dean Edwards uses the double dollar sign in his famous addEvent() JavaScript function. Here is an except containing the use of the double ...

PHP will not delete from MySQL

For some reason, JavaScript/PHP wont delete my data from MySQL! Here is the rundown of the problem. I have an array that displays all my MySQL entries in a nice format, with a button to delete the entry for each one individually. It looks like this: <?php include("login.php"); //connection to the database $dbhandle ...

How to assign unique DOM element ID

My GWT application creates text areas, each of which must have an ID in order to be useful to a third-party JavaScript library. I know how to assign an ID to a GWT widget; I'm after a good way of generating those unique ID's. ...

Why does this Javascript DOM code only workin FF, but not IE?

//create an instance of the XML parser if (window.ActiveXObject) { //Checking if the browser is IE xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async="false"; //make sure doc is fully loaded xmlDoc.load(strPath) //load the file in the parser if (xmlDoc.parseError.errorCode != 0) { alert("Error #: ...