This site has been archived. To learn more about our current products Ibexa Content, Ibexa Experience, Ibexa Commerce head over to the Ibexa Developer Portal

eZ Community » Forums » Developer » Ezjscore problem

Ezjscore problem

Ezjscore problem

Monday 08 November 2010 1:02:01 pm - 13 replies

I have created some ezjscore servercall functions.

When running the call i via the addressbar ( get the expected values.

When running it via a js file, is doesn't work.

function functionName(id,cat){
    jQuery(function( $ )
    // Any action here will work. E.g an alert, or console.log(); or something
        $.ez( 'someThing::someThingElse::'+id+'::'+cat, {arg1: ' '}, function( data )
        // Any action here will NOT work!

So,, all the information extraction is successfully done, and the right function is trigged, but within the $.ez() function nothing happens...

Anybody knows what the problem might be?

Monday 08 November 2010 1:14:17 pm

Hi Håvard ,

Have you made sure the generated JS actually is correct ? ie : if generated from a template, was it encapsulated in {literal} {/literal} tags ?


Monday 08 November 2010 1:19:07 pm

The funtion is in it's own .js file, and the calling of the function is done i the template. The calling is correct) happy.gif Emoticon

Would have gotten javascript errors if it wasn't?

Might be worth mentioning that the servercall returns the right values, when survailing it with firebug:
Response: 200 OK , and all the content i asked for is there...

Monday 08 November 2010 1:28:51 pm

Even when tracking the server's answer through Firebug, you see the correct content ? Json i suppose ?

If nothing in the callback function is run, it might mean that JS execution is stopping before the calback function is called in $.ez(..). Is the returned content (from the ajax call to the server) likely to contain unproper sequences of character ?

Monday 08 November 2010 1:38:06 pm

Even when tracking the server's answer through Firebug, you see the correct content ? Json i suppose ?

Yes (!) That's the weird part hehe..happy.gif Emoticon

As far as I can tell, there is nothing unproper about the chars.

I suspect there might be a typo somewhere in the 400 line long .js file, that f*** things up? Is that a possibility? Allthoug i thik that would be weird, becase if that is the matter, than nothing should have worked? Or?

Modified on Monday 08 November 2010 1:40:23 pm by Håvard Bergersen

Monday 08 November 2010 3:33:20 pm

In case it might help you: the svn version of the ggwebservices extension just had ezjscore support committed to it (lat night!).

You can use the extension to send ezjscore calls to the server itself, and have dumps of request and response printed to screen.

The response is also parsed as json, so if there is some 'bad' character ruining your responses, you should be able to spot it.

(ps: sorry for this self-promotion blunk.gif Emoticon )

Monday 08 November 2010 3:35:03 pm

ps: you can also test using instad of jquery, to see if the fault lies in the part of the js code that sits between the actual response and your own js response handler...

Modified on Monday 08 November 2010 3:35:25 pm by Gaetano Giunta

Tuesday 09 November 2010 12:48:06 pm

Hehe, thanks for the tip.. Will try it out happy.gif Emoticon

Tuesday 09 November 2010 1:30:20 pm

It seems the problem is between the .js and the .php files included. Both works fine seperatly, but when combining them they fail...?

Tuesday 09 November 2010 2:41:17 pm

Could you push this online somewhere, so that we can put hands on. Forum-debugging is not suitable to these "extreme weirdness" cases happy.gif Emoticon

Cheers !

Tuesday 09 November 2010 4:17:39 pm

Hmmmm... Maybe i could but,,

There is a jscore function, calling a custom fetch function, that fetches from a restricted windows 2005 server.. (my environment is linux..)

Sooo,, need less to say, it's not easy to recreate this.. happy.gif Emoticon

I suspect there is a error of some sort in the [...]functioncollection.php, OR is there som kind of problem connected to running ezFunctionHandler::execute on custom fetches via ezjscore? I don't know.. happy.gif Emoticon

Modified on Tuesday 09 November 2010 4:18:10 pm by Håvard Bergersen

Tuesday 09 November 2010 5:04:55 pm

As far as my experience goes (in coding the ezwebservicesapi extension), there is no problem in running a fetch from within an ezjscore function: (look at static method ezpublish_fetch

Wednesday 10 November 2010 4:09:54 pm

Any move on the topic ?

How about pasting the firebug output (of the XHR) plus de js code used in some snippet sharing place ?


Friday 12 November 2010 11:14:15 am

I'd go as far as suggest using Wireshark or the ff plugin livehttpheaders to debug this and get a reliable trace of the requests


You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from