i am using scriptaculous.js and prototype.js


my ajax is returning following tags (text)

<p id="tobeedited4">one</p> (should manually select "two")

and while calling the ajax it has

new Ajax.Updater('contact_div_edit',"./doit.php", {asynchronous:true, parameters:poststr,onComplete: showResponse, evalScripts:true});
onComplete: showResponse

my showResponse function goes like this

function showResponse()
{
new Ajax.InPlaceCollectionEditor(
  'tobeedited4', '_ajax_inplaceeditor_result.html', {
  collection: ['one','two','three'],
  value: 'two',
  ajaxOptions: {method: 'get'} //override so we can use a static for the result
});
}

i have included all the required js files and everythings goes fine (program flow)
But the problem is:
the p tag with id tobeedited4 is not visible from showResponse function ...


pliz help me to solve this issue.

I just want InPlaceCollectionEditor to apply on the tags after ajax call
Is there a way to solve this ???? is this possible ????

pliz anybody ... identify my mistake ...
i really need to get ride of this problem

Thanks for everyone's follow-up

i solved my funny problem ...

i've should put the script tag along with the ajax return ...
:D

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.