Jquery...Migrating Test to Live
Moderators: Jon, Steve, Ian, Dave
-
- Ebase User
- Posts: 95
- Joined: Wed Feb 27, 2013 5:16 pm
Jquery...Migrating Test to Live
Hi,
I have migrated a form to our Live server, the first that uses jquery. The form:
-> works within our test environment
-> works when called locally from a designer
-> works when called using the hostname within our network.
-> does NOT work when called externally
Any thought as to why this doesn't work...I would guess a file path but under Form properties -> Web Resources -> Client Scripts I have six entries, three of which are externally hosted API's (JQUERY, JQUERYUI and GMAPS) with correct URLS.
I am guessing it is a path issue..caused by our web server but what am I missing?
Has anyone else encountered a problem like this - probably a classic web development mistake...but it's got me!
I have migrated a form to our Live server, the first that uses jquery. The form:
-> works within our test environment
-> works when called locally from a designer
-> works when called using the hostname within our network.
-> does NOT work when called externally
Any thought as to why this doesn't work...I would guess a file path but under Form properties -> Web Resources -> Client Scripts I have six entries, three of which are externally hosted API's (JQUERY, JQUERYUI and GMAPS) with correct URLS.
I am guessing it is a path issue..caused by our web server but what am I missing?
Has anyone else encountered a problem like this - probably a classic web development mistake...but it's got me!
0 x
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
-
- Ebase User
- Posts: 95
- Joined: Wed Feb 27, 2013 5:16 pm
Hi,
Thanks - It is accessibly externally (only place it doesn't work) but still within testing as it does not fully function yet (jquery is one of two remaining problems - assuming the scripts work as expected).
I have opened up Firebug and taken a look in the Net tab as suggested, on moving onto the form page that include's the jquery (calendar and normal button) it looks like all the scripts load (see image):
http://s23.postimg.org/90m7n5auj/firebug_net_tab.jpg
I am going to migrate another form that uses jquery and see if it happens again (edit - the same issue occurs - works everywhere except externally).
Thanks - It is accessibly externally (only place it doesn't work) but still within testing as it does not fully function yet (jquery is one of two remaining problems - assuming the scripts work as expected).
I have opened up Firebug and taken a look in the Net tab as suggested, on moving onto the form page that include's the jquery (calendar and normal button) it looks like all the scripts load (see image):
http://s23.postimg.org/90m7n5auj/firebug_net_tab.jpg
I am going to migrate another form that uses jquery and see if it happens again (edit - the same issue occurs - works everywhere except externally).
Last edited by alexmcclune on Thu Dec 11, 2014 8:03 am, edited 2 times in total.
0 x
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
-
- Ebase User
- Posts: 95
- Joined: Wed Feb 27, 2013 5:16 pm
No Javascript errors as the functions are called via the HTML Element Properties -> Jquery code and ultimately nothing get's fired (the button does log the button click event but as it is jquery code nothing happens).Jon wrote:Yes, that all looks fine. What actually goes wrong? Do you have any Javascript errors at the point of failure?
Quick query regarding the Net Tab but a lot of the scripts are greyed out - when I review the same tab on the same form within our network the scripts are not greyed out...?!!Googling it now.
Edit Firebug does report this:
The request was resolved directly from the cache, so we have no response from the server. See below for the cached response.
Google returns this from StackExchange http://stackoverflow.com/questions/6797 ... -net-panel but it may need translated for a beginner - I have tried the same form in both I.E and Firefox and the jquery doesn't work.
0 x
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
Sprry, I meant Javascript errors in the browser, not the server - reproduce the problem with Firebug active, click the Console tab and scroll to the bottom.
All your scripts seem to have loaded OK (status 200 means OK + non-zero length). They may well have been resolved from the browser cache - you can always clear the cache in the browser if you want to, but it doesn't look to me that this is your problem.
All your scripts seem to have loaded OK (status 200 means OK + non-zero length). They may well have been resolved from the browser cache - you can always clear the cache in the browser if you want to, but it doesn't look to me that this is your problem.
0 x
-
- Ebase User
- Posts: 95
- Joined: Wed Feb 27, 2013 5:16 pm
Ah yes, we have some errors! On test we only have 1 error however on live we have 9 (including the same error as test) This screenshot details themhttp://s28.postimg.org/5euomd75p/js_errors.jpg
Ultimately the browser was blocking the content because the client script api URL's were using HTTP when our web server requires HTTPS. By changing these links to use // with no protocal it fixed the problem.
Ultimately the browser was blocking the content because the client script api URL's were using HTTP when our web server requires HTTPS. By changing these links to use // with no protocal it fixed the problem.
0 x
-
- Ebase User
- Posts: 95
- Joined: Wed Feb 27, 2013 5:16 pm
Following on from this Jon,
We have a JS function for errors:
If this is called from the client side the final command "form.callUrl.." doesn't seem to be executed. The page just "sticks" but I know the function is executed from the log's and the DB entry.
Any thoughts as to why the final command isn't fired?
We have a JS function for errors:
Code: Select all
function errorEbaseForm(){
var error_url = 'https://url/ufs_EXTERNAL_FORMS/ufsmain?formid=ERRORS&FRM_ERRORCODE=';
var error_code = 06; //Ebase Form Error...
tables.EXTERNAL_ERRORS.insertRow();
tables.EXTERNAL_ERRORS.CALL_ID.value = '';
tables.EXTERNAL_ERRORS.FORM_NAME.value = system.variables.$FORMID.value;
tables.EXTERNAL_ERRORS.CONTACT_ID.value = '';
tables.EXTERNAL_ERRORS.ERROR_DESCRIPTION.value = 'Error Code: ' + error_code + ': Ebase Form Error ';
tables.EXTERNAL_ERRORS.ERROR_CODE_ID.value = error_code;
tables.EXTERNAL_ERRORS.updateTable();
form.callUrl(error_url + error_code, null);
}
Any thoughts as to why the final command isn't fired?
0 x
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
I think this may be a bug i.e. call url doesn't work when called from the client api. We have an outstanding bug saying that upload similarly doesn't work and I suspect call url is the same problem.
I can only suggest you get the client to invoke the url instead of the server, after it's done the client call.
Regards
Jon
I can only suggest you get the client to invoke the url instead of the server, after it's done the client call.
Regards
Jon
0 x
-
- Ebase User
- Posts: 95
- Joined: Wed Feb 27, 2013 5:16 pm
Thanks Jon, can you advise?Jon wrote:I think this may be a bug i.e. call url doesn't work when called from the client api. We have an outstanding bug saying that upload similarly doesn't work and I suspect call url is the same problem.
I can only suggest you get the client to invoke the url instead of the server, after it's done the client call.
Regards
Jon
I am using the "executeFunction" and I understand that it can handle a failureCallBack if I write a client side function to handle the error url...bit stuck as to the code...Google suggest's a lot but I cannot see how to implement them within Ebase. Along the lines (this doesn't work - every occurance take's me to google..even successful submits):
Code: Select all
$eb.executeFunction("epdSubmitSync",null,true,true,window.location="http://www.google.com");
0 x
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
It could work like this: the client calls the server using the client api and specifies an error handling function which is called if the server crashes. The server function will detect failures using a try/catch mechanism - I'm guessing you are already doing this as you have created an errorEbaseForm() function to handle errors. After logging the error, the server function will abort - this is done deliberately so that the client's error handling function is executed.
Client code would look like this (error handling function is the fifth parameter):
Server function would look something like this:
Note: I found this only worked if there was no on error event specified for the form. If you have an on error event, it will intercept the form.abort() and won't return to the client.
Hope this makes sense.
Jon
Client code would look like this (error handling function is the fifth parameter):
Code: Select all
$eb.executeFunction("epdSubmitSync",null,true,true, function(reason) {window.location="http://www.google.com";});
Code: Select all
function epdSubmitSync()
{
try
{
...
}
catch (e)
{
errorEbaseForm(); //log the error
form.abort(e); //abort the function execution
}
}
Hope this makes sense.
Jon
0 x
-
- Ebase User
- Posts: 95
- Joined: Wed Feb 27, 2013 5:16 pm
Thanks Jon - that's great...very close to my final solution.
As I have already built a fair bit of error logging I was only actually missing the following command from the various error function calls:
Then the callback function correctly sends the user to the error form.
As I have already built a fair bit of error logging I was only actually missing the following command from the various error function calls:
Code: Select all
form.abort(e)
0 x
Who is online
Users browsing this forum: No registered users and 5 guests