I placed a custom javascript file in "userdata/custom/js". From what I understand, if you place javascript files in there, they are loaded automatically every time you run a program.
The javascript file loads perfectly in web browsers. However when I try to load my program in the "ProfoundUI Mobile Client", I get an error: Expression 'myFunction()' contains an error: myFunction is not defined".
I'm guessing my custom javascript file wasn't loaded, hence "myFunction" wasn't found.
I'm using an Android tablet to run the ProfoundUI Mobile Client application.
Custom javascript file not loading
-
- Profound User
- Posts: 91
- Joined: Fri Aug 03, 2012 11:07 am
- First Name: Paul
- Last Name: Ramcharitar
- Company Name: Banks DIH
- City: Georgetown
- Zip / Postal Code: 592
- Country: Guyana
- Contact:
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: Custom javascript file not loading
Files in the userdata/custom/js directory will be loaded automatically if you are using a PUI session in a web browser. They are not loaded automatically from the Profound UI Mobile Client, PhoneGap or Genie.
I would suggest using the 'External Javascript' property of your screen instead.
I would suggest using the 'External Javascript' property of your screen instead.
-
- Profound User
- Posts: 91
- Joined: Fri Aug 03, 2012 11:07 am
- First Name: Paul
- Last Name: Ramcharitar
- Company Name: Banks DIH
- City: Georgetown
- Zip / Postal Code: 592
- Country: Guyana
- Contact:
Re: Custom javascript file not loading
ok thanks
-
- Profound User
- Posts: 91
- Joined: Fri Aug 03, 2012 11:07 am
- First Name: Paul
- Last Name: Ramcharitar
- Company Name: Banks DIH
- City: Georgetown
- Zip / Postal Code: 592
- Country: Guyana
- Contact:
Re: Custom javascript file not loading
Hi, I used the external javascript and external css option, and none of them apply in the mobile client.
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: Custom javascript file not loading
You are using the screen-level properties, correct?
These should work in a mobile client.
These should work in a mobile client.
-
- Profound User
- Posts: 91
- Joined: Fri Aug 03, 2012 11:07 am
- First Name: Paul
- Last Name: Ramcharitar
- Company Name: Banks DIH
- City: Georgetown
- Zip / Postal Code: 592
- Country: Guyana
- Contact:
Re: Custom javascript file not loading
When I used "external javascript" and "external css" screen level properties, the files didn't load. Even when I wrapped the paths with "pui.normalizeURL".
However these functions worked for me on the browser and mobile client:
The files loaded as they should.
However these functions worked for me on the browser and mobile client:
Code: Select all
pui.loadJS({path: pui.normalizeURL("/profoundui/userdata/custom_js/GetCurrentTime.js"),callback: function() {startTime();}})
Code: Select all
pui.loadCSS(pui.normalizeURL("/profoundui/userdata/custom/css/custom.css"))
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: Custom javascript file not loading
Well, these APIs should work, too...
are you calling this from your onload event? Or when are you calling them?
are you calling this from your onload event? Or when are you calling them?
-
- Profound User
- Posts: 91
- Joined: Fri Aug 03, 2012 11:07 am
- First Name: Paul
- Last Name: Ramcharitar
- Company Name: Banks DIH
- City: Georgetown
- Zip / Postal Code: 592
- Country: Guyana
- Contact:
Re: Custom javascript file not loading
Yes in the onload event of the record format.
Who is online
Users browsing this forum: No registered users and 7 guests