How to send data using jQueryObjet.load(url, data) in script#

193 views Asked by At

I have this function in javascript:

$('#myElement').load('/some/url/', { parameter1: 0, parameter2: 1 });

How can I translate it in Script# ?

At the moment, I am unable to pass the data parameter. I have try this without success:

jQueryApi.jQuery.Select("#myElement").Load("/some/url/", "{ parameter1: 0, parameter2: 1 }");

The resulted compiled javascript code is (notice the " ' " around the data parameter):

$('#myElement').load('/some/url/', '{ parameter1: 0, parameter2: 1 }');

Thanks in advance

2

There are 2 answers

0
StebQC On BEST ANSWER

Found the solution here https://stackoverflow.com/a/7072152/1007232

I needed to create a new class that inherit the Record class.

3
Jamie Hutber On

Give this a whirl

$('#myElement').load('/some/url/', { 'parameter1': 0, 'parameter2': 1 });

Taking the quotes away from

"{ parameter1: 0, parameter2: 1 }"