JsActions is not defined

Jan 7, 2012 at 5:25 PM

I have done what you said on your Document Page

Unable to find @Html.JsAction() method

Then i have used  @Html.JsScript() on my _layout.chtml page

But no luck it gives

"Error: JsActions is not defined
Source File: http://localhost:2638/
Line: 42"

Then I have downloaded your test project from following link

http://jsaction.codeplex.com/releases/77545/download/307304

An run this application on my pc

This also give same error. I have used your latest version and also previous version but unable to get output.

Hope you will help me.

 

 

Coordinator
Jan 8, 2012 at 7:01 AM

Hello and thank you for your post.

I think your issue is due to mistakes using the helper.
I have uploaded a new minimal working test project that may be used as a guideline, you can download it here.

http://jsaction.codeplex.com/releases/view/80076

If you will not able to make it work anyway, upload YOUR project and let me download it, i will be happy to check it.
Vincenzo Chianese

Jan 8, 2012 at 8:44 AM
Edited Jan 8, 2012 at 8:44 AM

Thanks for replay.

I have downloaded your test project and run my pc.

After running it gives following out put  (including error)

http://flic.kr/p/b9nMkM

Hope you will help me.

Coordinator
Jan 9, 2012 at 5:54 PM

Your issue is very strange, since downloading test project MUST work.
Anyway i do not have firefox and javascript error handling can change from browsers to browsers.
Thank to another user i have fixed a javascript quoted string issue that may deny JsAction work propely at all. (thanks to vendi_naren) -> http://jsaction.codeplex.com/discussions/285223 and it has been solved in 0.3.2

My suggest is to download again test project, upgrade to 0.3.2 using nuget and test again.
Let me know the result!
Vincenzo Chianese.

Jan 10, 2012 at 3:53 AM

Thanks for replay.

Your extension  @Html.JsScript() doesn't write anything on my source page.

Thats why i have added following line of code manually

<script type="text/javascript" src="/JsAction?data="></script>

and then added following script on index page

<script type="text/javascript">
    $(document).ready(function () {
        JsActions.MyTestMethod(10, 15).then(function (data) { alert(data); });
    });
</script>

It shows output something like when i run my app by pressing F5

http://www.flickr.com/photos/12455847@N07/6671341823/

If i run my app by pressing Ctrl + F5 then it shows previous error menas

JsActions is not defined

Hope you will help me.

 

 

Coordinator
Jan 10, 2012 at 9:48 AM

The output from flickr link is the right one, since the JSON object returned is 150 (look at the controller source code).
It's very very strange that HtmlHelper has no output. It simply injects that code in your page (http://jsaction.codeplex.com/SourceControl/changeset/view/13648)

It may be another kind of issue. May you upload your project? I will download it and check if something is wrong.

Jan 11, 2012 at 10:15 AM

I have uploaded test project for your kind consideration.

Download

Here i have also upload a picture(image) showing error message.

If i press f5 only then it runs ok. if i press ctrl + F5 then it shows error like uploaded image.

Hope u will help me.

Coordinator
Jan 17, 2012 at 12:47 PM
Edited Jan 17, 2012 at 12:48 PM

Hello!
I opened your project and i see that you're still using JsAction 0.1 (with less features and more bugs).
However it works.
Use nuGet and upgrade to 0.3.2 right now!

P.S -> The right test project is this one: http://jsaction.codeplex.com/releases/80076/download/325386
Download, test but remember always to check for updates!

Vincenzo Chianese