javascript

js windows.location.replace not working with a hash in URL

Ok, I have an ajax call which takes care of some server side settings (I'm using this for log in, language switches...), if, and only if, server side settings are actually changed as a result of this call, I want to refresh the current page. ( without reposting POST form data, should we be on a page right after a POST). A simple JS in t...

Doing an onchange event on a field in the parent window using jquery

Hi all, I am not sure if this can be done. In the parent window, I have the following line, <input type="hidden" name="myField" id="myField" value=""> This parent window would open a pop-up window, where it would allow the users to make their own selections. Upon clicking submit in this pop-up window, it would assign the selection ...

How do I create a popup window when Firefox is not in focus

Is it possible to make a popup window actually pop "up" in Firefox when Firefox isn't the foreground window. Standard behavior is for the window to pop under when Firefox isn't in focus. If there is a way to use JavaScript to do this that would be best. But if not, I would also like any Firefox extensions or settings that would allow th...

JS Nav Hover action http://barnumdesign.com/x/about

Hello I'm trying to attain a nav hover effect like this: http://joseavillez.pt/ Except with the nav background full. any guidance? i've tried using the following code to target it but i'm not sure what's wrong: JS Function function menusHoverFunction() { $('#LeftNav ul li a').each(function() { $(this).css({'backgroundPositio...

Javascript: persist window object refrence?

My javascript code open some windows trough: var win = window.open(); I store the win refernce in an array with all the other opened windows. Everything works fine, until the opener is refreshed. So what i'd like to achive is to get back all the references to the opened windows when the "master" window is loaded. To realize this i...

Garbage Collection and JavaScript "delete": Is this overkill/obfuscation, or a good practice?

I just read this question and the accepted answer: http://stackoverflow.com/questions/864516/what-is-javascript-garbage-collection In the answer, Noldorin referenced some guidelines from apple. Here is the part I'm concerned with: Use delete statements. Whenever you create an object using a new statement, pair it with a delete sta...

My site is vulnerable to this script..How do i patch it ?

One guy tried to exploit it using this script http://www.searchr.us/web-search.phtml?search=%22%3E%3Cscript%3Ealert%28String.fromCharCode%2872%29+String.fromCharCode%28105%29%29;%3C/script%3E How do i stop it ? And he also said that it is vulnerable to XSS and LPI...Please help me stop it. Thanking You, ...

How to call a javascript function and get the html code it returns ,Java,Android

There is a HTML page that has a javascript function in it.This function returns a frame with a random picture. Is there a way to call this function and get the HTML code that is hidding? (So i get the image) Exactly i want to get a html stream from GoogleServices.js by calling: GS_googleAddAdSenseService("ca-pub-YOU RPUBIDHERE"); GS_...

window.location onload in Firefox

Probably a simple question for everyone. This displays the alert with the location in Chrome and Safari but it doesn't work in Firefox <html> <head> <script type="text/javascript"> function onload() { var loc = window.location; alert("url is " +loc); return false; } </script> </head> <body onload="onload()"> </body> </html> An...

How to overlay a picture with another one?

What's a good method to overlay a picture with another one in HTML and CSS or jQuery? ...

PHP code or javascript code for converting html to xhtml

I'm looking a php code or js code for converting html to xhtml. PHP tidy is not my option because my hosting does not support it. ...

Change cursor position in the contenteditable div after changing innerHTML

Hello, I have a simple contenteditable div with some text in it. On onkeyup event i want to replace whole content (innerHTML) of the div based on regex. For example, HTML: some text, more text and $even more text Function in which i plan to get all text with $ ($even in example above) and wrap it in span tag: div.onkeypress = fun...

List of HTML, CSS, JavaScript and jQuery things that can cause cross-browser compatibility issues

looking for collective knowledge - all i want are things to watch out and be careful while using which can cause cross-browser incompatibility issues.. so that you can look for their alternatives or check them out before deployment on large scale... ...

Undefined jQuery value when trying to correct JSLint complaint: "Don't make functions within a loop"

Within a jQuery ajax function data supplied to the callback function on success is defined with success: function (data) { ... but this makes JSLint unhappy ("Don't make functions within a loop"). If I follow the suggestion in http://stackoverflow.com/questions/3037598/how-to-get-around-the-jslint-error-dont-make-functions-within-a-...

IE7 viewport dimensions including scrollbars

My definition of "viewport" is everything between the browser's borders (visible area + scrollbar) http://xirc.chez.com/ie7.html As you can see, I tried: document.body VS document.documentElement scroll* client* offset* getBoundingClientRect() html { 100% } body { 100% } The Internet Explorer 7 bug per say is that offset* and getBo...

How to highlight links in the div on mouseover.

Hi, I have div with a few links spread out in the content. I would like to highlight all the links in the div onmouseover. Is there jquery solution that works in FF, IE and chrome. Thanks. ...

Google translate in-app, is it possible?

Is it possible to translate a webpage within a webuiview using google translate? I am aware that you can use their rest services to translate some text, but I have not found any way to translate a web page. You can do some trick with the url but that adds along with the translate page a banner at the top that I don't need. ...

javascript reference to undefined property

Using Firefox, working on a Firefox extension, I continually get a javascript warning: reference to undefined property mySidebar.context.netProgress I have tried multiple ways of testing the value: if (mySidebar.context.netProgress === undefined) { And if (typeof mySidebar.context.netProgress == "undefined") { And if (!mySideba...

Create a notification popup with a specific animation in mind.. possible?

Hey guys, how would I go about making the following animation for my form submissions? I figured instead of typing it, I would create a visual.. Let me know if you think this is easily done. ...

How to include a .js file in my XBL?

Is there a way to include a javascript file to a XBL instead of copy all the script to it? ...