Project

General

Profile

Defect #516

callback params need string escaping

Added by David Workman almost 12 years ago. Updated almost 12 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Start date:
05/27/2012
Due date:
% Done:

0%

Estimated time:
Browser (if web client):

Description

callback params need to have escaped out quotes around them. so the sample code is wrong:

var jsToExecute = "var sum = 1 + 2";
plugins.WebClientUtils.executeClientSideJS(jsToExecute, myCallBackMethod, ['sum'])

corrected sample code:

var jsToExecute = "var sum = 1 + 2";
plugins.WebClientUtils.executeClientSideJS(jsToExecute, myCallBackMethod, ['\"sum\"'])

History

#1

Updated by David Workman almost 12 years ago

my bad, this is working correctly. the trick is unescaped parameters need to match a variable set in the js to execute. so this works:

var jsToExecute = "var sum = 1 + 2";
plugins.WebClientUtils.executeClientSideJS(jsToExecute, myCallBackMethod, ['sum'])
// sum = 3

this works:
var jsToExecute = "var sum = 1 + 2";
plugins.WebClientUtils.executeClientSideJS(jsToExecute, myCallBackMethod, ['\"sum\"'])
// sum = "sum"

this doesn't work:
var jsToExecute = "var sum = 1 + 2";
plugins.WebClientUtils.executeClientSideJS(jsToExecute, myCallBackMethod, ['product'])
// callback method doesn't get executed

this works:
var jsToExecute = "var sum = 1 + 2";
plugins.WebClientUtils.executeClientSideJS(jsToExecute, myCallBackMethod, ['\"product\"'])
// callback is executed

Also available in: Atom PDF