BRMarcom Posted November 13, 2023 Share Posted November 13, 2023 Is it possible to Load a URL from Jquery within the OnJobEnd callback? try { // I can see this Print("Loading Jquery New"); Load('E:\\APPS\\TEST\\jQuery_min.js'); // But I don't see this and i'm not catching a Print("Jquery Loaded"); var jqxhr = $.get( "https://api.marketpowerwebdev.com/fusionPro/disposition.cfm?fpid=123456", function() { Print( "success" ); }) } catch (error) { Print(error); } Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted November 13, 2023 Share Posted November 13, 2023 You should be able to load most .js files with the Load() function. However, the JavaScript engine that FusionPro uses is based on an older standard, so some newer JS files may have syntax that it doesn't recognize. Let's back up a bit. Can you explain what you're trying to accomplish? There may be a simpler way to do it. Quote Link to comment Share on other sites More sharing options...
BRMarcom Posted November 13, 2023 Author Share Posted November 13, 2023 We are finding that under heavy load, the checkstatus function on the server is coming back with a timeout but the job is completing. Rather than keep polling the FusionPro server API for the status, I'd like to have the OnJobEnd pull a URL that could them pass a few Parameters indicating that the job has finished. So the in the OnJobEnd there would be a call similar to this: $.get("https://api.someurl.com/disposition.cfm?fpSessionid=1112221111&status=Complete&pages=234") Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted November 13, 2023 Share Posted November 13, 2023 You should be able to just do this: CreateResource("https://api.someurl.com/disposition.cfm?fpSessionid=1112221111&status=Complete&pages=234"); That will call the server and download the URL to a Resource object, though if you don't need that object you can ignore the return code. Also, depending on the version of the FP Server API you're using, there may be a newer version which has better performance. Please contact Support to explore options. Quote Link to comment Share on other sites More sharing options...
BRMarcom Posted November 13, 2023 Author Share Posted November 13, 2023 That gives me an error regardless of the URL used. And the Description in the building blocks indicates "CreateResource(filename [,type] [,nonExistOK] [,encoding]) Creates a graphic or text resource from a file on disk." Are you sure that can be used? Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted November 14, 2023 Share Posted November 14, 2023 21 hours ago, BRMarcom said: That gives me an error regardless of the URL used. And the Description in the building blocks indicates "CreateResource(filename [,type] [,nonExistOK] [,encoding]) Creates a graphic or text resource from a file on disk." Are you sure that can be used? It can take a URL to a graphic or text file, such as this in a graphic rule: return CreateResource("https://www.chicago.gov/content/dam/city/depts/dca/Public Art/CloudGate.jpg"); If what the URL points to isn't a file that can be downloaded, then you will get an error, but it should still call the server. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.