| | |
AJAX vs IE issue
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Aug 2008
Posts: 381
Reputation:
Solved Threads: 33
I agree, that is weird
If I understand correctly, declaring a var within a function block changes the scope of the variable from the global scope (window) to the local scope (function), thus avoids namespace collisions if you have like-variable names in the global scope. Maybe this is why it worked in my environment, I didn't have any other javascript on the page besides this function.
??? Glad you got it to work though !!!
:-)
If I understand correctly, declaring a var within a function block changes the scope of the variable from the global scope (window) to the local scope (function), thus avoids namespace collisions if you have like-variable names in the global scope. Maybe this is why it worked in my environment, I didn't have any other javascript on the page besides this function.
??? Glad you got it to work though !!!
:-)
•
•
Join Date: Aug 2008
Posts: 381
Reputation:
Solved Threads: 33
•
•
•
•
If I declare "var xmlHttp" as a global, it only works in FF. If I declare it inside of makePOSTRequest (like the above example), then it only works in IE.
Did you change the values of your alertContents function from xmlHttp to this, when the xmlHttp is no longer in the global scope (when it is declared in the function)?
IF not your function might have trouble seeing those values ?
I'm tired, sorry I can't be of more help ... but it was working in all of my browsers earlier today.
G'night
On the global/local declaration issue, one of the things going on is that Firefox's JS interpreter correctly handles variable scope (the variable only exists inside of the scope where it's declared) and IE's does not (all variables are effectively global).
Chaos
Lost Souls: text based RPG
MUDseek: MUD gaming search
Lost Souls: text based RPG
MUDseek: MUD gaming search
![]() |
Similar Threads
- IE AJAX issue (JavaScript / DHTML / AJAX)
- Using Ajax.Updater in IE (JavaScript / DHTML / AJAX)
- ajax won't work without the www in url (JavaScript / DHTML / AJAX)
- Urgent help needed regarding executing Scripts in AJAX response (JavaScript / DHTML / AJAX)
- Issue with Javascript embedded in C# (ASP.NET)
- listbox--issue php (PHP)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Troubleshoot script
- Next Thread: Ajax and server relation
Views: 2854 | Replies: 14
| Thread Tools | Search this Thread |
Tag cloud for JavaScript / DHTML / AJAX
acid2 ajax ajaxcode ajaxhelp animate array automatically autoplay beta boarder box bug button calendar captcha card cart codes column cookies createrange() css cursor date debugger decimal design developer dom download dropdown element enter error events firefox firehose flash focus form frameworks getselection google gwt html htmlform iframe image() images index java javascript javascripts jawascriptruntimeerror jquery jsp listbox maps marquee masterpage menu microsoft mimic mp3 mp4 offline onmouseover parameters php player post problem programming prototype rating redirect regex safari scale scriptlets search select size sources sql starrating text textarea toggle twitter validation variables w3c web website window windowofwords windowsxp xml xspf





