sample.js contains hardware function like check for hardware drivers is installed or not.
For testing and debugging purpose it is sample.js is on my local machine
And I placed in . and when I run web app on browser , browser unable to find sample.js because sample.js is on user/desktop/myapplication/sample.js directory. and I have given <script src ="../sample.js" type="text/javascript" charset="UTF-8"></script> .
Thats all.
I need a right path or whatever in so browser could load it.
In a cgi app, you can upload the js file and simply point to it.
In a standalone app (which is the case for debug), you need to create a WebFile, which means you cannot do a static reference in App.Header, since the WebFile changes path each time it is created.
Function HandleSpecialURL(Request As WebRequest) Handles HandleSpecialURL as Boolean
if Request.path = "sample.js" then
request.print sample
return true
end if
End Function
I have put my own functions in a constant called “sample”. You can load your sample.js into a variable with Texinputstream so it gets all the necessary content.
That will be nice and I got your point,
This may be one way, but what if I place the sample.js to framework directory like you suggested http://mygreatsite.com/framework/sample.js
where does the http://127.0.0.1/framework located?
If it is created on runtime then how could I copy sample.js to framework directory.
There may be also other directoris such as Resource.
Please suggest how could I copy sample.js to framework or Resource directoy of http://127.0.0.1/
Is there anybody who knows path of http://127.0.0.1:8080/ while running web app?
I have wasted my whole day to investigating how to add .js file to xojo web app. @Michel Bujardet : suggested answer is nice but is not useful way. I need to add js file on tag anyhow,
Please suggest steps or link. May be there is very simple solution.
Michel’s way is pretty much the simplest way to do it.
If you’re going to get more complex than that, you should look at the WebSDK for creating custom controls.