gotoURL and exeJavascriptDirect not working

Confirmed or possible bug reports and workarounds

gotoURL and exeJavascriptDirect not working

Postby Kataleena » Sat Sep 16, 2017 5:31 am

I need urgent help, I updated PowerPac today and published my book and now the gotoURL on the exit button no longer works, I have it set to target "current", it loads the page but some of the toolbook content is still on the page.

Also I use exeJavascriptDirect() to load a pdf into a toolbook and it's not longer working either, the pdf loads behind the box "Current" box.

var rtn = tbfunction_pgGotoURL( "Current", "../dialog/iframe.html");
setTimeout( function() { rtn.src = "/test.pdf#toolbar=0&navpanes=0&zoom=100"; }, 500);

Is there a way I can roll back the version of PowerPac, as I need to get this out to a client asap.


Thanks Kate
Kataleena
 
Posts: 49
Joined: Sun Feb 23, 2014 10:05 pm

Re: gotoURL and exeJavascriptDirect not working

Postby Clifton » Sat Sep 16, 2017 5:35 am

Can you provide a screenshot which shows what is happening ... or at least a clear description of the error you are getting.
Thanks.

(What version did you have before the problem appeared?)

You can test exeJavascriptDirect() code in this page:
http://www.pgsoftwaretools.com/powerpac/assessments/exec-js/

When I enter your code like this, it outputs the correct string: (you can try it yourself)
    Image 1.png
    exeJavascriptDirect() Code Test
    Image 1.png (63.38 KiB) Viewed 7172 times
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: gotoURL and exeJavascriptDirect not working

Postby Clifton » Sat Sep 16, 2017 6:08 am

I think I may see the problem.
Try replacing "current" with the keyword "top" and the entire contents of your window should get replaced by the URL. The previous version of the PowerPac would have exhibited the same behavior so using the latest version is not really the problem.

I will need to modify the parameter help dialog to clarify this issue. In your case, using the keyword "current" is the same as using the keyword "toolbook" and this mode often has undesirable side effects.

If you want to embed your URL into the current page, use a field (named something like "myPDF" and sized to fully occupy the page) and make sure its layer is on top before loading the content.
    changeObjectLayer( "myPDF", "top" );
    pgGotoURL( "myPDF", [ value of rtn.src from exeJavascriptDirect() ] );

Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: gotoURL and exeJavascriptDirect not working

Postby Clifton » Sat Sep 16, 2017 7:24 am

After further review, it seems the keyword "current" should produce content loading top level, however, it actually loads in the background element of the ToolBook frame. This is a behavior of the object referencing engine in the latest PowerPac versions (probably most v13 and v14 releases). Nevertheless, you can correct the anomaly by using the keyword "top" instead of "current".

I will schedule a fix for this so "current" works as expected for pgGotoURL() in future releases.

Thank you for identifying this issue!!
 
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: gotoURL and exeJavascriptDirect not working

Postby Clifton » Sat Sep 16, 2017 8:01 am

A patched PowerPac version to v14.023.0 fixes the "current" keyword issue in pgGotoURL().

There are NO ISSUES with exeJavascriptDirect() relative to your post.

Enjoy!
 
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: gotoURL and exeJavascriptDirect not working

Postby Kataleena » Sun Sep 17, 2017 6:18 am

Hi Clifton,

Thanks for your fast response, I have tested my book again and it's now working since your update.

Thanks
Kate
Kataleena
 
Posts: 49
Joined: Sun Feb 23, 2014 10:05 pm

Re: gotoURL and exeJavascriptDirect not working

Postby Clifton » Sun Sep 17, 2017 7:38 am

Glad all it well!
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: gotoURL and exeJavascriptDirect not working

Postby Kataleena » Tue Oct 03, 2017 3:54 am

Hi,

I'm not sure if I should of started a new post but I handed over my course my client is getting two Error messages in IE 11 only, as I can't replicated them in my dev environment I was wondering if you can atleast tell me if toolbook is throwing the errors or PowerPac.

First error is when the course loads and I use a lot of different PowePac Functions
Error on Loading.JPG
Error on Loading.JPG (17.67 KiB) Viewed 7158 times


Second error is when the video tries to load using the htmlVideoLoader function
Video error.JPG
Video error.JPG (15.12 KiB) Viewed 7158 times


I have not modified the code in these areas and the last time I handed them over I was using JAVASCRIPT POWERPAC VERSION: 12.916.5 and there was no problems but using 14.024.0 to package has produce the errors.

If you need my details about which functions I'm using let me know and TIA.

Kate
Kataleena
 
Posts: 49
Joined: Sun Feb 23, 2014 10:05 pm

Re: gotoURL and exeJavascriptDirect not working

Postby Clifton » Tue Oct 03, 2017 6:21 am

Couple of questions:
  1. Are the errors related in that they occur as a consequence of each other? In other words, once the first error occurs, then the second error is generated.
  2. Do they occur if another browser is used (e.g.: Firefox or Chrome)?
  3. Does every computer the client uses generate the same results or do some client machines successfully run the application?
What I can tell from the messages:
  1. The first error is generated by ToolBook, but it does not mean that it is ToolBook's fault. It is just telling you that you are trying to use a value as a number and it is failing because the value is not a number and may even be null or unset.
  2. The second message is generated by the PowerPac when the video attempts to load into the object named "VideoPlayer." It seems likely that the first message may be producing the second since the PowerPac is simply indicating it cannot load a movie into "VideoPlayer" with the parameters it is receiving.
  3. The first message is the one I'm most concerned about because it begins with "http/1.1 Bad Request." This means that your application tried to request information from the server or server database and could not process the request. When you tested this on YOUR server and did not receive an error, it likely because the server-side script requesting information could be processed and finished successfully and apparently returned a value to the application that could be treated or used as a valid number for other tasks. However, on the client's server, (assuming their server is different from yours), the process fails and is probably throwing a string complaining of the problem it encountered. The string returned from the client's server that causes the "http/1.1 Bad Request" is the string you need to know exactly what its content is. It likely holds the key to the problem.
What do I think you will find?
The error string in #3 above may be one that indicates a server-side script is using an incompatible scripting language on the client's server to request data. Your server doesn't experience this because it had all the installed server dependencies to process the request and succeeded. An example of this could be you are using a script that requires PHP v5.6 or greater and the client's server has v5.3 installed.
Another possibility:
If an LMS is involved, it could be that the client is requesting a stored value from a previous session that was never actually set. In this case, your application needs a contingency for this sort of thing.

In summary:
It is the FIRST error dialog that needs to be addressed and once the issue is tracked down and solved you may eliminate the second automatically.

If it is possible to zip up the export (and dependencies) and send it to me, I may be able to at least simulate the problem. But, it would be best if you could address some of the questions and possible issues above so we can eliminate some of this logic. Otherwise, this would be "trouble-shooting in the dark," which is not very productive.

Would also recommend starting a different topic since I don't think this truly a "bug report."
 
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: gotoURL and exeJavascriptDirect not working

Postby Kataleena » Tue Oct 03, 2017 7:06 am

Hi Clifton,

Thank you for your time in writing the extensive post, unfortunately I can't zip a copy due to IP issue but you have given me some great ideas to try and solve the problem.

If I need any further help, I will create a new post.

Thanks
Kate
Kataleena
 
Posts: 49
Joined: Sun Feb 23, 2014 10:05 pm


Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 2 guests

cron