Ajax returns & instead of &, Any ideas?
First off Hello to the community, first time posting here
I've used the jQuery ajax code to return some HTML for a page. The HTML contains links with query strings on them,
-
?key=value&key=value
etc etc
However when the html is returned to the page the link href becomes
-
?key=value&key=value
Now as far as clicking, this isn't an issue, but the links href is used for a lightbox plugin, which doesn't work if there is an & only if its &.
Just wondered if any one could help.
jQuery code:
-
$.fn.loadTools = function(){
var memberID = 1847; // testing purposes only. this will need to be pulled in from the session/login
var params = [
{name: 'status', value: 'pageLoad'},
{name: 'memberID', value: memberID}
];
$.ajax({
type: 'POST',
url: 'lib/ajax/main.php',
data: params,
success: function(html){
$('#button-bar').html(html);
}
});
};
main.php output:
-
//---snip
<div class="button" id="addeventBtn"><!-- Adding -->
<a href="index.php?action=page1&page=adding&KeepThis=true&TB_iframe=true&height=300&width=600&modal=true" class="thickbox">
<img src="images/add.png" border="0" height="16" width="16" alt="Add Event" onmouseover="Tip('Add a new event to My Social Calendar');" onmouseout="UnTip();" />
</a>
</div>
//---snip
main.html page:
-
<div id="msc-container">
<div id="title-bar">My Social Calendar</div>
<div id="button-bar">
</div>
<div id="eventsContainer">
</div>
</div>