The entire process
User "drags" an item into a "box".
The JavaScript then runs my script thusly:
pickMovie(item.id);Then my script does this (shortened for brevity's sake):
function pickMovie(int) {Basically all it does is capture the ID, and send it to the PHP page. At the PHP page, it does a nice big request from the database, and returns the following:
xmlHttpPoll=GetXmlHttpObjecta()
var url="/pickmovie.php?element_id="+int
url=url+"&sid="+Math.random()
xmlHttpPoll.onreadystatechange=stateChangeda
xmlHttpPoll.open("GET",url,true)
xmlHttpPoll.send(null)
}
So now this is returned to the JavaScript to output like:<li><a href="http://www.blogger.com/titleinfo.php
?id=1&keepThis=true&TB_iframe=true&height=609
&width=761" class="smoothbox">Title</a></li>
function stateChangeda(){Pretty simple? The output we found had all the &'s turned into &'s. No idea why, but so hence why the front end developer did the replace here.
if (xmlHttpPoll.readyState==4 || xmlHttpPoll.readyState=="complete"){
$('demo').setStyle('display', 'none');
$('searchResultsCont').setStyle('display', 'block');
var resultsList = xmlHttpPoll.responseText;
var amp ="&";
var updatedResultsList = resultsList.replace(/&/g,amp);
$('searchResultsUl').innerHTML=updatedResultsList;
}
}
Doesn't work.. I mean the link works, but it doesn't use the smoothbox script. It works elsewhere on the page, where it is simply written, but not when returned through AJAX.
I'll post more as we learn more!
BFN
0 comments:
Post a Comment