Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Help with JQuery!

Posted on 2009-06-30
5
Medium Priority
?
663 Views
Last Modified: 2013-12-08
Hi,

I am using JQuery to submit contact forms and ratings to my server from the user. My server responses with xml that is processed by the subspacecomm function, which I have not posted. The script I did include works, but in IE6 (which accounted for 19% of my hits this month) it simply just is silent after clicking the button.

The behavior should be User Click > Form Serialize > Post to URL > Receive Data > Parse with Function > Modify HTML with Response. IE seems to execute all events except for the parsing. Is there a solution to this? I am receiving the data just fine (server side), but I would like to alert the user that we received the data.

I would be willing to accept a method that checked for the div named message that is created in the parsing function.

It (the script as is) works in Firefox, but I have not tested it in Opera, Safari, or IE 7/8.

$(function() 
{
        $(".openchannel").click(function() 
        {
                // hide button
                $('#commbadge').hide();
                // submit attached form
                var submission = $("form").serialize() + "&jsubmit=true";
                // acquire the url to submit to
                var url = $("input#url").val();
                // submit form using ajax and expect an xml response
                $.post(url,submission,function(xml){subspacecomm(xml);});
                return false;
     });
});

Open in new window

0
Comment
Question by:dilithiumtoys
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 29

Expert Comment

by:Badotz
ID: 24750723
Not to be impertinent, but have you read the jquery documentation?

Knowing nothing of jquery, is your Ajax asynchonous? If so, where do you specify that?
0
 

Author Comment

by:dilithiumtoys
ID: 24751358
Yes I have read the documentation. This issue is browser specific. I wanted to know if anyone created a work around. AJAX is always asynchronous, therefore specification of that is not required.
0
 
LVL 29

Expert Comment

by:Badotz
ID: 24754236
>>AJAX is always asynchronous, therefore specification of that is not required.

Perhaps in some corners of the world, but certainly not the www world.

IE6 does not have a built-in XMLHttpRequest object - perhaps that is part of your problem?
0
 
LVL 82

Accepted Solution

by:
hielo earned 2000 total points
ID: 24768460
try this:
$(	function() 
	{
        $(".openchannel").click(function() 
        	{
                // hide button
                $('#commbadge').hide();
                // submit attached form
                var submission = $("form").serialize() + "&jsubmit=true";
                // acquire the url to submit to
                var url = $("input#url").val();
                // submit form using ajax and expect an xml response
                //$.post(url,submission,function(xml){subspacecomm(xml);} );
			 $.ajax(
			 	{"data":submission
			 	,"dataType":"xml"
				,"error":function (XMLHttpRequest, textStatus, errorThrown) { alert("Error occurred\n"+textStatus + " \n" +errorThrown);}
				,"success":function(xml,textStatus){alert("Request succeeded - processing response...\n" + xml);subspacecomm(xml);} 
			 	,"type":"POST"
				,"url":url
				,"complete":function (XMLHttpRequest, textStatus) {alert("The ajax request completed with status: " + textStatus);}
				}
			 );
                return false;
     	});
	}
);

Open in new window

0
 

Author Closing Comment

by:dilithiumtoys
ID: 31598563
Thank you so much! I was able to get a response out of IE that there wasnt a parser available. I can customize this to alert the user that the request was sent.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question