[jQuery] not able to append new tag in XML in IE
I am making an ajax call and in response, i am getting an XML. And then using data from XML, i am creating a form. I stored response XMl in a variable like this var xmlData = $(data); If there is any change in any field of form then i am changing corresponding node value in xmlData by appending new node in related node like this : var val = document.createElement('{nodename}'); $(val).text({changed value}); $({corresponding node}).append($(val)); This is working fine in FF but not working in IE. Kindly guide me how can i solve this problem. Thanks in advance to all for providing guidance.
[jQuery] Re: not able to append new tag in XML in IE
Thanks for your reply. But this is not working.The data which i got as a result from ajax call on success, i stored it in a global variable. Like this var xmlData = $(data); But when i was executing like you told, it is not creating an element. On Aug 26, 1:49 pm, Paolo Chiodi wrote: > when you do document.createElement you create an element that is child > of "document" document. > Try to create the element with data.createElement. > > Paolo > > On Wed, Aug 26, 2009 at 10:14 AM, g...@iec wrote: > > > I am making an ajax call and in response, i am getting an XML. > > And then using data from XML, i am creating a form. > > I stored response XMl in a variable like this > > var xmlData = $(data); > > If there is any change in any field of form then i am changing > > corresponding node value in xmlData > > by appending new node in related node like this : > > var val = document.createElement('{nodename}'); > > $(val).text({changed value}); > > $({corresponding node}).append($(val)); > > > This is working fine in FF but not working in IE. > > > Kindly guide me how can i solve this problem. > > > Thanks in advance to all for providing guidance.
[jQuery] Re: not able to append new tag in XML in IE
In ajax call, i set dataType as 'xml' and on success, i call a function in which i am passing xml which i got as response. And in the function i a assigning that data to a global variable so that i can access it from any function. I am assigning it to a global variable as shown below : xyz : function(data){ xmlData = $(data); . } like this and then i need to modify xmldata if there is any change in form and on submit of form, i am sending xmlData back to server using ajax call. So please guide me accordingly to modify xml in global variable on change in form data from any other function. On Aug 26, 3:47 pm, Paolo Chiodi wrote: > You don't have to use xmlData, which is the jquery object, but data > which is the xml dom (if you set xml as type of the request) > > Paolo > > On Wed, Aug 26, 2009 at 12:35 PM, g...@iec wrote: > > > Thanks for your reply. > > But this is not working.The data which i got as a result from ajax > > call on success, i stored it in a global variable. > > Like this > > var xmlData = $(data); > > But when i was executing like you told, it is not creating an > > element. > > > On Aug 26, 1:49 pm, Paolo Chiodi wrote: > >> when you do document.createElement you create an element that is child > >> of "document" document. > >> Try to create the element with data.createElement. > > >> Paolo > > >> On Wed, Aug 26, 2009 at 10:14 AM, g...@iec wrote: > > >> > I am making an ajax call and in response, i am getting an XML. > >> > And then using data from XML, i am creating a form. > >> > I stored response XMl in a variable like this > >> > var xmlData = $(data); > >> > If there is any change in any field of form then i am changing > >> > corresponding node value in xmlData > >> > by appending new node in related node like this : > >> > var val = document.createElement('{nodename}'); > >> > $(val).text({changed value}); > >> > $({corresponding node}).append($(val)); > > >> > This is working fine in FF but not working in IE. > > >> > Kindly guide me how can i solve this problem. > > >> > Thanks in advance to all for providing guidance.
[jQuery] Re: not able to append new tag in XML in IE
Hi Paolo, Thanks for your suggestion but this still not work. But i find a solution and it should be done as mentioned below: var new_ele = xmlData.createElement('new_ele_name'); $(new_ele).text({value which you want to put inside tag}); $({your selector}).append(new_ele); And this work both in ie and ff. On Aug 26, 11:24 pm, Paolo Chiodi wrote: > Maybe not the best solution, but here's something that work: > > var new_element = xmlData.get(0).createElement('new_element_name'); > xmlData.find('your_query').append(new_element); > > On Wed, Aug 26, 2009 at 1:49 PM, g...@iec wrote: > > > In ajax call, i set dataType as 'xml' and on success, i call a > > function in which i am passing xml which i got as response. > > And in the function i a assigning that data to a global variable so > > that i can access it from any function. > > I am assigning it to a global variable as shown below : > > xyz : function(data){ > > xmlData = $(data); > > . > > > > } > > like this and then i need to modify xmldata if there is any change in > > form and on submit of form, i am sending xmlData back to server using > > ajax call. > > > So please guide me accordingly to modify xml in global variable on > > change in form data from any other function. > > > On Aug 26, 3:47 pm, Paolo Chiodi wrote: > >> You don't have to use xmlData, which is the jquery object, but data > >> which is the xml dom (if you set xml as type of the request) > > >> Paolo > > >> On Wed, Aug 26, 2009 at 12:35 PM, g...@iec wrote: > > >> > Thanks for your reply. > >> > But this is not working.The data which i got as a result from ajax > >> > call on success, i stored it in a global variable. > >> > Like this > >> > var xmlData = $(data); > >> > But when i was executing like you told, it is not creating an > >> > element. > > >> > On Aug 26, 1:49 pm, Paolo Chiodi wrote: > >> >> when you do document.createElement you create an element that is child > >> >> of "document" document. > >> >> Try to create the element with data.createElement. > > >> >> Paolo > > >> >> On Wed, Aug 26, 2009 at 10:14 AM, g...@iec wrote: > > >> >> > I am making an ajax call and in response, i am getting an XML. > >> >> > And then using data from XML, i am creating a form. > >> >> > I stored response XMl in a variable like this > >> >> > var xmlData = $(data); > >> >> > If there is any change in any field of form then i am changing > >> >> > corresponding node value in xmlData > >> >> > by appending new node in related node like this : > >> >> > var val = document.createElement('{nodename}'); > >> >> > $(val).text({changed value}); > >> >> > $({corresponding node}).append($(val)); > > >> >> > This is working fine in FF but not working in IE. > > >> >> > Kindly guide me how can i solve this problem. > > >> >> > Thanks in advance to all for providing guidance.
[jQuery] $.ajax() issue
Hi all, I have an issue. I am submitting XML data using ajax call which updates data on server. It works fine in firefox but gave 404 error in IE. The ajax call which i am using is mentioned below : var url = '/' + serviceContext + '/services/content/update/' + structid; alert(nodeData); $.ajax({ url: url, type: 'POST', data: nodeData, contentType: 'application/xml;charset= UTF-8', cache: false, processData: false, dataType: 'xml', success: function(){ changeCounter = 0; $('#messages').text('Changes to metadata updated successfully.'); return false; }, error: function(xhr, textStatus, errorThrown) { $('#messages').text('Error! HTTP Error code ' + xhr.status).addClass('warning'); return false; } }); Here nodeData is a xml which i am sending to server. So i need help to figure out whether this is client-side or server- side issue. This call works fine in firefox and updates data on server but in ie it gave 404 error (and response from server says : ' Could not find resource at "'/' + serviceContext + '/services/content/update/' + structid" link. ') Thanks to all in advance for providing suggestions.
[jQuery] Re: $.ajax() issue
Is there any other way to find out the root cause apart from these. On Aug 29, 6:55 pm, MorningZ wrote: > Have you tried an HTTP monitor like Fiddler (http://www.getfiddler.com) to > see what is going on when the $.ajax request > starts? > > That will help diagnose for sure > > On Aug 29, 9:46 am, "g...@iec" wrote: > > > Hi all, > > > I have an issue. > > I am submitting XML data using ajax call which updates data on server. > > It works fine in firefox but gave 404 error in IE. > > The ajax call which i am using is mentioned below : > > > var url = '/' + serviceContext + '/services/content/update/' + > > structid; > > alert(nodeData); > > $.ajax({ > > url: url, > > type: 'POST', > > data: nodeData, > > contentType: 'application/xml;charset= UTF-8', > > cache: false, > > processData: false, > > dataType: 'xml', > > success: function(){ > > changeCounter = 0; > > $('#messages').text('Changes to metadata > > updated successfully.'); > > return false; > > }, > > error: function(xhr, textStatus, errorThrown) { > > $('#messages').text('Error! HTTP Error code > > ' + > > xhr.status).addClass('warning'); > > return false; > > } > > }); > > > Here nodeData is a xml which i am sending to server. > > So i need help to figure out whether this is client-side or server- > > side issue. > > This call works fine in firefox and updates data on server but in ie > > it gave 404 error (and response from server says : ' Could not find > > resource at "'/' + serviceContext + '/services/content/update/' + > > structid" link. ') > > > Thanks to all in advance for providing suggestions.
[jQuery] Re: $.ajax() issue
Hi, I installed fiddler and analyised the traffic but i am not able to find the result. So, can you help me out to find whats going wrong? On Aug 29, 7:13 pm, MorningZ wrote: > I do not understand > > did you not ask in the original post: > > "So i need help to figure out whether this is client-side or server- > sideissue" > > Using Fiddler will tell you if it's a client side or server sideissue > because it will show you EXACTLY what the browser is trying > to do something littering your code with "alert"-s is not going > to accomplish... > > Whatever i suppose good luck solving yourissuehow you see fit > > On Aug 29, 10:01 am, "g...@iec" wrote: > > > Is there any other way to find out the root cause apart from these. > > > On Aug 29, 6:55 pm, MorningZ wrote: > > > > Have you tried an HTTP monitor like Fiddler (http://www.getfiddler.com) > > > to see what is going on when the $.ajaxrequest > > > starts? > > > > That will help diagnose for sure > > > > On Aug 29, 9:46 am, "g...@iec" wrote: > > > > > Hi all, > > > > > I have anissue. > > > > I am submitting XML data usingajaxcall which updates data on server. > > > > It works fine in firefox but gave 404 error in IE. > > > > Theajaxcall which i am using is mentioned below : > > > > > var url = '/' + serviceContext + '/services/content/update/' + > > > > structid; > > > > alert(nodeData); > > > > $.ajax({ > > > > url: url, > > > > type: 'POST', > > > > data: nodeData, > > > > contentType: 'application/xml;charset= UTF-8', > > > > cache: false, > > > > processData: false, > > > > dataType: 'xml', > > > > success: function(){ > > > > changeCounter = 0; > > > > $('#messages').text('Changes to > > > > metadata updated successfully.'); > > > > return false; > > > > }, > > > > error: function(xhr, textStatus, errorThrown) { > > > > $('#messages').text('Error! HTTP Error > > > > code ' + > > > > xhr.status).addClass('warning'); > > > > return false; > > > > } > > > > }); > > > > > Here nodeData is a xml which i am sending to server. > > > > So i need help to figure out whether this is client-side or server- > > > > sideissue. > > > > This call works fine in firefox and updates data on server but in ie > > > > it gave 404 error (and response from server says : ' Could not find > > > > resource at "'/' + serviceContext + '/services/content/update/' + > > > > structid" link. ') > > > > > Thanks to all in advance for providing suggestions.
[jQuery] Re: $.ajax() issue
Hi MorningZ, I found the problem. In ie, 'contentType' changed from 'application/xml' to 'text/xml' and on server-side we are expecting 'application/xml'.And in firefox,contentType is application/xml. But don't know how it got changed? Any idea is welcomed. On Sep 1, 11:22 am, "g...@iec" wrote: > Hi, > I installed fiddler and analyised the traffic but i am not able to > find the result. > So, can you help me out to find whats going wrong? > > On Aug 29, 7:13 pm, MorningZ wrote: > > > I do not understand > > > did you not ask in the original post: > > > "So i need help to figure out whether this is client-side or server- > > sideissue" > > > Using Fiddler will tell you if it's a client side or server sideissue > > because it will show you EXACTLY what the browser is trying > > to do something littering your code with "alert"-s is not going > > to accomplish... > > > Whatever i suppose good luck solving yourissuehow you see fit > > > On Aug 29, 10:01 am, "g...@iec" wrote: > > > > Is there any other way to find out the root cause apart from these. > > > > On Aug 29, 6:55 pm, MorningZ wrote: > > > > > Have you tried an HTTP monitor like Fiddler (http://www.getfiddler.com) > > > > to see what is going on when the $.ajaxrequest > > > > starts? > > > > > That will help diagnose for sure > > > > > On Aug 29, 9:46 am, "g...@iec" wrote: > > > > > > Hi all, > > > > > > I have anissue. > > > > > I am submitting XML data usingajaxcall which updates data on server. > > > > > It works fine in firefox but gave 404 error in IE. > > > > > Theajaxcall which i am using is mentioned below : > > > > > > var url = '/' + serviceContext + '/services/content/update/' + > > > > > structid; > > > > > alert(nodeData); > > > > > $.ajax({ > > > > > url: url, > > > > > type: 'POST', > > > > > data: nodeData, > > > > > contentType: 'application/xml;charset= UTF-8', > > > > > cache: false, > > > > > processData: false, > > > > > dataType: 'xml', > > > > > success: function(){ > > > > > changeCounter = 0; > > > > > $('#messages').text('Changes to > > > > > metadata updated successfully.'); > > > > > return false; > > > > > }, > > > > > error: function(xhr, textStatus, errorThrown) > > > > > { > > > > > $('#messages').text('Error! HTTP > > > > > Error code ' + > > > > > xhr.status).addClass('warning'); > > > > > return false; > > > > > } > > > > > }); > > > > > > Here nodeData is a xml which i am sending to server. > > > > > So i need help to figure out whether this is client-side or server- > > > > > sideissue. > > > > > This call works fine in firefox and updates data on server but in ie > > > > > it gave 404 error (and response from server says : ' Could not find > > > > > resource at "'/' + serviceContext + '/services/content/update/' + > > > > > structid" link. ') > > > > > > Thanks to all in advance for providing suggestions.
[jQuery] remove() and empy() not work for xml
Hi All, I got stuck in a situation. I have to remove a node from XML using jquery but remove() and empty() is not working. var xmlData = {xml document}; $(xmlData).find({node}).each(function(){ $(this).remove(); or $(this).parent().empty(); }) This work fine for firefox but not work in ie. Can anybody provide me with some workaround so that i'll be able to remove node from XML. Thanks to all for their suggestions in advance.
[jQuery] Re: remove() and empy() not work for xml
Hi.can anybody help me out to come out of this On Sep 5, 7:50 pm, "g...@iec" wrote: > Hi All, > > I got stuck in a situation. > > I have to remove a node from XML using jquery but remove() and empty() > is not working. > > var xmlData = {xml document}; > $(xmlData).find({node}).each(function(){ > $(this).remove(); or $(this).parent().empty(); > > }) > > This work fine for firefox but not work in ie. > > Can anybody provide me with some workaround so that i'll be able to > remove node from XML. > > Thanks to all for their suggestions in advance.
[jQuery] Re: remove() and empy() not work for xml
thanks for your suggestion On Sep 8, 7:37 am, RobG wrote: > On Sep 7, 3:42 pm, "g...@iec" wrote: > > > Hi.can anybody help me out to come out of this > > You many need to use getElementsByTagNameNS('*',tagName). To remove > nodes try: > > this.parentNode.removeChild(this); > > -- > Rob
[jQuery] issue regarding live event
Hi all, I had encounter a situation in which 'live' seems to be not working in ie but nworking fine in ff. $('a.start').mousedown(function(){ {some code} }); this code is written in js file. in another js file , $('a.start').live('mousedown', function(){ {some code} }); is written in other js file. This code works fine in ff but does not work in ie. on click of this anchor, whole code is removed and again dump in page including this anchor. Event again bind to anchor in firefox but does not binds in ie. Help me out to get rid off this issue. Thanks to all in advance for your suggestion.
[jQuery] Re: issue regarding live event
Hi, i can't put code on success of AJAX call because that method is used at various places. So suggest me how should i make it work without modifying that method. On Sep 22, 9:18 pm, waseem sabjee wrote: > hi there i here is a work arround i made up for the live event with an AJAX > call > basically i made an ajax call and injecting HTML into a div - a live() click > event was not executing only on IE7 for some odd reason > > so i included my click event within the success : function of that AJAX > call at it worked out well for me > > if you can give me more details about your situation may be i can help you > more. > > On Tue, Sep 22, 2009 at 4:32 PM, g...@iec wrote: > > > Hi all, > > > I had encounter a situation in which 'live' seems to be not working in > > ie but nworking fine in ff. > > > $('a.start').mousedown(function(){ > > {some code} > > }); > > > this code is written in js file. > > > in another js file , > > > $('a.start').live('mousedown', function(){ > > {some code} > > }); > > is written in other js file. > > > This code works fine in ff but does not work in ie. > > > on click of this anchor, whole code is removed and again dump in page > > including this anchor. > > Event again bind to anchor in firefox but does not binds in ie. > > > Help me out to get rid off this issue. > > > Thanks to all in advance for your suggestion.
[jQuery] JQuery ui dialog issue
Hi all, I have an issue. I am showing modal loading dialog while making ajax call. My dialog config is shown below : $('#loadingSearch').dialog({ autoOpen: false, modal: !$.browser.msie, bgiframe: true, width: 270, height: 'auto', title:'Loading Search', draggable: false, resizable: false }); $('.ui-dialog .ui-dialog-titlebar').hide(); $('#loadingSearch > div:eq(1)').css({'left':'135px'}); $('#loadingSearch').dialog('open'); and closed by using following code : $('#loadingSearch').dialog('close'); $('#loadingSearch').dialog('destroy'); $('.ui-widget-overlay').remove(); This code works fine in FF but not in ie. In ie, after removing loading dialog , checkboxes are not clickable and no text get typed in textboxes. So help me to resove this issue. Thanks to all for their suggestions.
[jQuery] Re: JQuery ui dialog issue
Help me out of this issue... i got stuck On Sep 23, 6:08 pm, "g...@iec" wrote: > Hi all, > > I have an issue. > > I am showing modal loading dialog while making ajax call. > My dialog config is shown below : > > $('#loadingSearch').dialog({ > autoOpen: false, > modal: !$.browser.msie, > bgiframe: true, > width: 270, > height: 'auto', > title:'Loading Search', > draggable: false, > resizable: false > }); > $('.ui-dialog .ui-dialog-titlebar').hide(); > $('#loadingSearch > div:eq(1)').css({'left':'135px'}); > $('#loadingSearch').dialog('open'); > > and closed by using following code : > > $('#loadingSearch').dialog('close'); > $('#loadingSearch').dialog('destroy'); > $('.ui-widget-overlay').remove(); > > This code works fine in FF but not in ie. > > In ie, after removing loading dialog , checkboxes are not clickable > and no text get typed in textboxes. > > So help me to resove this issue. > > Thanks to all for their suggestions.
[jQuery] Re: Creating a new tag
var link = $('').attr(attribute_name,value); $(target_element).append(link); This will work. On Sep 24, 2:06 pm, Coxy wrote: > How do I create a new tag with jquery? > > I tried something like this: > > link = $('a').attr({ > class : 'logoLink', > target : '_blank', > href : 'http://www.someurl.com/' > }); > > And then appended it to another image, but this added every link that > already existed on the page.
[jQuery] Re: select cannot check checkboxes' states
$('[type="checkbox"]:checked').each(function(){}) This works. On Sep 24, 2:22 pm, "Jonathan Vanherpe (T & T NV)" wrote: > tried Sam Doyle's response yet? It looks like that might be the proper way. > $("input[type=checkbox]:checked").each(function(){}); > > Jonathan > > > > Xi Shen wrote: > > > tried, not working ;( > > > On Thu, Sep 24, 2009 at 5:03 PM, Jonathan Vanherpe (T& T NV) > > wrote: > > >> Xi Shen wrote: > > >>> hi, > > >>> i have a group of check boxes, and i want to iterator over all the > >>> checked ones. i use the following code, but without luck. > > >>> $("input[type=checkbox][checked=true]").each(function()...); > > >>> can someone give a better solution? > > >> [checked=checked] ? > > >> -- > >> Jonathan Vanherpe - Tallieu& Tallieu NV - jonat...@tnt.be > > -- > Jonathan Vanherpe - Tallieu & Tallieu NV - jonat...@tnt.be
[jQuery] how to parse xml with namespace ?????
Hi all, I have came across an issue related to xml parsing. Here is code for parsing xml with namespace : var data = {xml content}; $(data).find('{namespace}\\:nodename').each(function() { { Code to perform something.} }); This code works fine in IE and FF and xml got parsed as expected. But it is not workng with safari. Can anybody help me out to parse xml with namespaces using jquery so that it work fine in all browsers??? Thanks to all for showing there concern.
[jQuery] Re: XML Writing
Here is code : var xml = {xml content}; $(xml).find('{nodename}').text({changed value}); This code works fine. And content should be proper xml and not string. On Nov 16, 12:39 pm, Shane wrote: > Hey guys, > > Is it possible to use jQuery to write to XML nodes for example I have: > > a > > > I want to do something like: > $(xml).find('type').text("b"); > > This however isn't working. So I was wondering if there was a > different way to do this. > > Thanks, > Shane.
[jQuery] Re: how to parse xml with namespace ?????
Can anybody provide me with some suggestions regarding above mentioned issue On Nov 17, 7:15 pm, "g...@iec" wrote: > Hi all, > > I have came across an issue related to xml parsing. > > Here is code for parsing xml with namespace : > > var data = {xml content}; > $(data).find('{namespace}\\:nodename').each(function() { > { Code to perform something.} > > }); > > This code works fine in IE and FF and xml got parsed as expected. > But it is not workng with safari. > > Can anybody help me out to parse xml with namespaces using jquery so > that it work fine in all browsers??? > > Thanks to all for showing there concern.
[jQuery] Re: how to parse xml with namespace ?????
Here is the code : var data = {xml content}; $(data).find('{namespace}\\:nodename').each(function() { { Code to perform something.} }); On Nov 18, 2:42 pm, Peter wrote: > Can you show the code you are using. > > On Nov 18, 1:18 pm, "g...@iec" wrote:> Can anybody > provide me with some suggestions regarding above mentioned > > issue > > > On Nov 17, 7:15 pm, "g...@iec" wrote: > > > > Hi all, > > > > I have came across an issue related to xml parsing. > > > > Here is code for parsing xml with namespace : > > > > var data = {xml content}; > > > $(data).find('{namespace}\\:nodename').each(function() { > > > { Code to perform something.} > > > > }); > > > > This code works fine in IE and FF and xml got parsed as expected. > > > But it is not workng with safari. > > > > Can anybody help me out to parse xml with namespaces using jquery so > > > that it work fine in all browsers??? > > > > Thanks to all for showing there concern.