javascript

visibility property not working as expected in javascript function

I have a table: <table> <tr> <td colspan="2"><h2>Order Awards here:</h2></td> </tr> <tr> <td class="aocBlack">Delivery:</td> <td> <select style="width: 200px;" id="deliveryMethod" name="deliveryMethod" size="1" onchange="showMailing()"> <option value="print">I will print it myself.</option> <option value="mail">...

Problem with Internet Explorer 7 and only on server

Hello, I'm making a website and one part of javascript need to disable browser back button and only on some pages that have specific element on it. Here is the script: function recallhashcheck() { setTimeout("checkhashb()",50); } function checkhashb() { if (String(window.location.href).indexOf("#back") != -1) { window.locat...

jQuery: Add ui-close button to resizable/draggable ?

How can I add a close button to a draggable/resizable div? I understand that I am essentially describing a dialog, but I have to be able to take advantage of a few of the properties of resizable/draggable (such as containment) that are not a part of dialog. Any ideas? ...

Preventing XSS attack when using Javascript's CreateElement

My company has partners that embed a few of our web pages into their site by way of a dynamically generated iframe. The source URL for the iframe comes from the query string on the partner's site so I want to make sure there is no risk of a cross site scripting attack since we are using untrusted input as the iframe's source. The sou...

Javascript: after loading a page, is there any way to inhibit the use of a .js file loaded using the browser?

Hi, after loading a page, is there any way to inhibit the use of a .js? I mean using any tool (firebug for example) in Firefox . Regards Javi ...

Javascript: with any Firefox plugin (Firebug, whatever), how to see the route from a .js has been loaded?

Hi, with any Firefox plugin (Firebug, whatever), how to see the route from a .js has been loaded? Regards Javi ...

Default javascript version in browsers

Which version of JavaScript do use browsers by default? I read a documentation about different versions of javascripts supported by Firefox (https://developer.mozilla.org/en/JavaScript). There are many interesting and useful things. Unfortunately, I am confused now which version might I use in the development. ...

How to make a "hybrid" HTML drop-down list that can work as a text box as well?

For my website, I need to have a way for users to enter their cities. I'd like to use 2 drop-down list for that: a "State" and a "City" drop-down lists. The choices in the "City" list would depend on what "State' has been selected. However, there bound to be cases where a user's "City" is not in the drop-down list. To handle those case...

jquery selector issue

I have a div which in jquery's document ready I append - using $("#div id").append('html text') syntax - with 10 or so more div child elements. once this is done I try to check the content of the child divs via alert($(".classname")); and it comes back with: function(a){if(c.isFunction(a))return this.each(function(b){var d=c(this);d.te...

Javascript eval() for function with argument

How do I do this? function myUIEvent() { var iCheckFcn = "isInFavorites"; var itemSrc = ui.item.find("img").attr("src"); if (eval(iCheckFcn(itemSrc))) { alert("it's a favorite"); } function isInFavorites(url) { return true; } // returns boolean ...

Compare selected form values?

Hello, I have two select fields and I want to compare them so if they both equal United States then alert the user. Here is what I have but it doesn't seem to work. if(document.getElementById('country_o').value == "United States" AND document.getElementById('country_d').value == "United States") { window.alert("BOTH US!"); } ...

How to fallback to entirely different index page if user has javascript disable?

I have a large, dynamically generated, single page website that heavily relies on javascript. I want to have a fallback for people without javascript. Each version must have different php code, so basically I need an entirely different index page. I dont want to wrap EVERYTHING in javascript, and EVERYTHING ELSE in tags. Unless there i...

EXTRACTING data from a particular url and populating a dictionary in iPhone

Hi everyone, I am a newbie to iPhone app development. I would like to know the procedure to extract data from a particular website which itself populates the webpage's content using a jquery. I would like to extract this data and display it in my own format. Here is the url: source webpage Kindly let me know if there exists any fram...

javascript name vs ID

As far as I know there are two ways to get the value from a textbox either document.formName.textboxName.value; or document.getElementbyId('textboxId').value; As I understand using form name would mean I have less code to write, as name can be used for posting data and getting the value (apart from using ajax). As where if I was ju...

Chrome kicks user out of a form when trying to preventDefault with javascript after an alert popup

I have some simple form validation going on, and it works in FF and IE. Simply put, if there is a date out of range on the form, javascript prevents the form submission. However, in Chrome, it's totally broken. When the preventDefault fires, Chrome logs the user out of the application and they get kicked back to the index/login page. And...

FB-Root Is Null, but only Sometimes in Firefox and IE

I have a Facebook Login Button on a login.php page on my website, and when its there it works like it should. But for some reason when I have a click on a link to this login.php the button doesn't appear. When I refresh the page, the button pops up. When I manually go to login.php the button appears every time. This seems to only happen...

Callback function?

I need to callback Javascript function in my code, but not firing. I am providing details what I am doing?. I have input button in the page that calling javascript function. There I am loading another ProfilePic.aspx page. ProfilePic.aspx has FileUpload, OK and cancle button <input type=button value="Change Image" onclick="javascript:...

undefined behaviour with an un intialised member variable in javascript

Hello, It's 20:30 and I'm after a 6 hour bug hunt of an irritating bug caused by an uninitialized member variable. In the our previous version we had the next few lines of code: var aList = new Array; for (var iDx=0; iDx < nNumOfElements; iDx++) { // Some code aList.nCount = someValue; //This line } aList.sort(function(a, b)...

No response from web page

I have a web page where I redirect the user to if I see that IP is not valid. I want that user's browser will get no response but kept into waiting state, but I also want that my server thread is not blocked for that request. So the idea was that server will response quickly but the user' browser will put into waiting loop to discourage ...

How to replace Javascript of production website with local Javascript?

On my production website, I have compiled Javascript. <script src="/js/mycode.min.js"></script> It would be very convient for debugging if I could make my browser replace that with <script src="http://localhost/js/mycode1.js"&gt;&lt;/script&gt; <script src="http://localhost/js/mycode2.js"&gt;&lt;/script&gt; ... I know I could manip...