How to do I Resolve Relative Server Links When my HTML Source is not on Server
One solution would be to convert all of the relative links to absolute links. I can convert the html source file anyway I wish, but ideally I would like to modify the html source as little as possible, for example insert a function that modifies the result of the src attribute.
How would I go about this? Is there any trick I can use to define where the relative home is? Am I going to get into any scripting security gotchas?
You can use the html <base> element, in the head of the document, to resolve any relative links on the page.
you won't be able to fetch linked resources using ajax from a file-based html document.
you can link to images, stylesheets, and javscripts on the remote server, but not html documents.
Create, Share, and Debug HTML pages and snippets with a cool new web app I helped create: pagedemos.com
base element looks like exactly what I need.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)