JQuery replaceWith problem?

The issue is with the in your id, you need to escape the for the selector to work correctly Example: $("#n-1\\.12\\.2\\.2\\.4") With that being said, the easiest option would be to use document.getElementById() and simply use replaceWith() function updateTrip(xml, success, jqXHR) { var para = $(xml); var id = para. Attr('id'); var a = document. GetElementById(id); $(a).

ReplaceWith(para); } Example on jsfiddle or if you want to do the replace() option it would look like this: function updateTrip(xml, success, jqXHR) { var para = $(xml); var id = para. Attr('id'). Replace(/\.

/g, '\\. '); $('#' + id). ReplaceWith(para); } Example on jsfiddle.

The issue is with the . In your id, you need to escape the . For the selector to work correctly.

Example: $("#n-1\\.12\\.2\\.2\\.4") With that being said, the easiest option would be to use document.getElementById() and simply use .replaceWith() function updateTrip(xml, success, jqXHR) { var para = $(xml); var id = para. Attr('id'); var a = document. GetElementById(id); $(a).

ReplaceWith(para); } Example on jsfiddle or if you want to do the replace() option it would look like this: function updateTrip(xml, success, jqXHR) { var para = $(xml); var id = para. Attr('id'). Replace(/\.

/g, '\\. '); $('#' + id). ReplaceWith(para); } Example on jsfiddle.

It's advisable to steer clear of periods in IDs, even though they are permitted, it causes havoc in sizzle and other selector libraries. This post explains nicely. – Orbling May 11 at 22:57 Thanks both for the answers - the more minimal javascript version works fine but I'll have to consider recoding ids – Chris Wallace May 12 at 6:37.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions