Jump to content

ajax call via prototype, target contains JS


benjwlee

Recommended Posts

A simple web page call through prototype, and resolve to:

Line 5: Char: 12 Error: Object expected

running on IE6, prototype 1.6.0.2

I believe the GO checkbox in callee trying to access dosomething got denied.

I think I need to evaluate the callee script part. Was thinking prototype evalScripts:true would do, but didn't.

Anybody has any idea how to resolve this?

BTW, this is a whittled down version, I can't move the JS function to the caller program.

 

Callee (test.htm):

<head> Callee </head>

<body>

<script>

function DoSomething() {

alert('i am here');

}

</script>

 

<input name="input" type="checkbox" value="" onChange="alert('1');DoSomething();"/>GO

<div id="contentData"></div>

</body>

</html>

 

Caller(i.html):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head> caller </head>

<body>

<script type="text/javascript" language="javascript" src="prototype.js"></script>

<script language="javascript">

function update(div,ajaxParam){

  var obj=new Ajax.Updater({success: div},

    'test.htm',

    {parameters:ajaxParam,

    evalScripts:true

    }

  );

}

</script>

 

<cfoutput>

<input name="r" type="radio" onclick="update('content',' ');" />CallMe

</cfoutput>

<div id="content"></div>

</body>

</html>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.