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>

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.