• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Ajax and CF: Broken in Firefox v2.

Contributor ,
Mar 09, 2007 Mar 09, 2007

Copy link to clipboard

Copied

I'm making a simple Ajax call to my CF server and returning
a result. It just determines whether the session is still going.

It works fine in Firefox 1.5 and IE 7. Now as I get ready to demo it,
the demo machine has Firefox 2 and the Ajax is broken! Seems Firefox
has messed with Ajax in some way.

The strange thing is that Javascript IS turned on on the machine that's
got FFv2, however, despite that clicking the button doesn't produce an
alert. And it's coded to show up no matter what.


Here's the javascript on my page. Any ideas would be appreciated!

-Rick

<script>
var loggedIn = false;
function My_Request(){ http( 'GET' , 'JSMX.cfm' ,
My_Response ); }
function My_Response(obj){
if (anythingwewant == 1) {
loggedIn = true;
alert(loggedIn);
}
else {
//alert(loggedIn);
loggedIn = false;
}
}

</script>
<script>
function isLoggedIn(url_add) {
My_Request();
//alert(loggedIn);
if (loggedIn == true) {
alert(loggedIn);
window.location=url_add;
}
else {
alert(loggedIn);
window.location="logout.cfm";

}
}
</script>
TOPICS
Advanced techniques

Views

625

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Mar 12, 2007 Mar 12, 2007

Copy link to clipboard

Copied

You might want to consider installing FireBug on that machine - its a plugin for firefox that has super-charged javascript debugger capabilities. It will show you immediately if there is something firefox doesn't like with your code and tell you exactly what the problem is.

And its free.

http://www.getfirebug.com/

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 12, 2007 Mar 12, 2007

Copy link to clipboard

Copied

Michael,

Thanks for replying.

I'm having a hard time figuring out why the same code:
1) Works on my PC, both when the browser was Firefox v1.5 AND when I
upgraded to v2.0.0.2.
2) Works in IE 7 everywhere;
3) Doesn't work on either Firefox version from other machines.

Is this a windows thing?

I have Firebug on my main machine (on on which every thing's hunky dory),
but I can't necessarily install it on other machines.

Grr.

Rick

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Mar 12, 2007 Mar 12, 2007

Copy link to clipboard

Copied

So your code doesn't work on ANY firefox version running on another client machine? Grr is right. The only thing I can think of is to double check the firefox security settings, and check the source code generated by CF to make sure your main page and AJAX page are creating the HTML you are expecting.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 12, 2007 Mar 12, 2007

Copy link to clipboard

Copied

Speaking of Firebug.... Firebug's behavior may yield an important clue. If it is installed
and enabled, everything works fine. If I disable it, badda bing: my app is broken!

What would enabling Firebug ? do

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Mar 12, 2007 Mar 12, 2007

Copy link to clipboard

Copied

Good question. So when you disable it on your development machine, the app stops working?

Unfortunately, I don't know enough about firebug to give you a helpful answer. The solution may be to break down your javascript and test it line by line. I would add the AJAX call last, as that seems to be the most complex part.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 12, 2007 Mar 12, 2007

Copy link to clipboard

Copied

LATEST
Use prototype ajax library.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation