cf,
I can't immediately see why it's not working however two things occur to me:On repeated use the ajax success function would create more than one div with id="appLinks". I think this would cause $("#appLinks").append(......) to fail on second and subsequent calls (maybe without a Javascript error).
If the alert works without escape characters, then the append(...) shouldn't need them either.
Airshow
Airshow
WiFi Lounge Lizard
2,683 posts since Apr 2009
Reputation Points: 321
Solved Threads: 372
But I've just noticed $("#content").empty(); at the top there. So my first point is probably incorrect.
Sorry, even less help than I first thought.Airshow
Airshow
WiFi Lounge Lizard
2,683 posts since Apr 2009
Reputation Points: 321
Solved Threads: 372
cf,
I have had another look at the code and the alert gif and I think it's a simple question of avoiding nested double quotes in the composed HTML.
Change :
$("#appLinks").append('<a href=\"javascript:window.open(\"' + $(this).find("LINK").attr("VALUE") + '\",\"' + $(this).find("WINDOW").text() + '\",\"' + $(this).find("FEATURES").text() + '\");\">' + $(this).find("TITLE").text() + '</a>');
to:
$("#appLinks").append('<a href="" onclick="window.open(\'' + $(this).find("LINK").attr("VALUE") + '\',\'' + $(this).find("WINDOW").text() + '\',\'' + $(this).find("FEATURES").text() + '\'); return false;">' + $(this).find("TITLE").text() + '</a>');
Nested doubles are substituted for singles.
I tested as far as I can with alert and document.write() and my suggested code certainly parses out OK - no javascript error and the win.open() works when the resulting link is clicked.Airshow
Airshow
WiFi Lounge Lizard
2,683 posts since Apr 2009
Reputation Points: 321
Solved Threads: 372