I have created a Suitlet that creates a HTML page ...
# suitescript
w
I have created a Suitlet that creates a HTML page using a variable with all the HTML markup. At the end I have a
context.response.write(html)
to diaplay the page. This works fine. The down side it is I would like to put one of the HTML <script> tags in a seperate file so it is easier to edit and I don't have to convert every line to a string by putting it inside
+'html javascript code goes in here'
. I am able to do this with a
<script src="https://.... ">
tag but once the suitelet runs and loads this file it no longer runs a variable I've declared at the beginning of my Suitelet, also I start getting 404 errors about a Trusted file not found. Which has the Netsuite Domain. Just wondering if anyone has any ideas.. Worst case I'll continue with adding my HTML in as string lines with the plus sign. Thanks
m
Is your src correct? Did you get it form the file cabinet? (should look like this 'https://YOURACCOUNTID.app.netsuite.com/core/media/media.nl?id=SOMENUMBER&amp;c=SOMENUMBER&amp;h=SOMENUMBER&amp;_xt=.js')
w
Yes the source does load and I can see that it loaded in the Development screen on the browser.
m
One sec... helping with a customer service call on my company's end
Actually, better yet, can you post the code that loads the file (the full script tag)
I replace my account number with ??????
m
Hmmm... that's wierd.
And if you remove that script line from the HTML is the error gone?
Just want to check and make sure it's related to the script
w
Yes.. if I copy the contents of the script file and put it back within the script tags, all works again no errors.
That's what the url of the one that fails.
m
try the following URLs
for the script
Actually wait... before that
Can you tell me what the full URL Of your homepage is (replace the Account ID though)
The reason is because the ??????-sb1 is looking really wierd
why sb1?
sb1 is our sandbox account
@Michael Pope I'm going to try what eric suggested and see if I can get that to works. Thanks for your help.
m
Okay. Sounds cool. In any case, I don't know why your seeing the error
It might be related to sandbox or not
I use <script> tags on Suitelets, and for me I don't get that error, so what your seeing is kinda perplexing =p
Sorry I wasn't more help
w
You helped by making sure I was doing it the right way.. which it seems I was.. might be something in the rest of my code that caused the issue... Oh well thanks again.