Closed
Bug 299840
Opened 19 years ago
Closed 17 years ago
Relative URL's of external files (CSS/Stylesheets) do not work when used in Dynamically Created Pages
Categories
(Core :: DOM: Core & HTML, enhancement)
Tracking
()
RESOLVED
DUPLICATE
of bug 376809
People
(Reporter: ckorhonen, Unassigned)
Details
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.7.8) Gecko/20050511 Firefox/1.0.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.7.8) Gecko/20050511 Firefox/1.0.4
I am using Javascript to dynamically create a popup window upon a page event.
The code I am using looks something like the function below, apologies for not
providing a URL.
The popup window opens fine, however the Javascript and CSS files included in
the header are not loaded. I realise that they are relative URL's, as opposed to
absolute however this does not seem to bother browsers such as Internet
Explorer, and in a corporate environment where an application is moving between
production and test servers the absolute URL is likely to change.
Code to launch popup:
function openWindow(){
var g =
window.open('','foo','height=600,width=500,toolbar=0,resizable=1,scrollbars=1');
g.document.write('<html><head>');
g.document.write('<style type="text/css" media="all">@import
url("css/style.css");</style>');
g.document.write('<script type="text/javascript" src="scripts.js"></script>');
g.document.write('</head><body>foo</body></html>');
g.document.close();
}
Reproducible: Always
Steps to Reproduce:
1. Implement Code Provided
2. Launch Popup
3. Observe lack of JS/Styles.
Actual Results:
The popup window opened, however the stylesheet and JS file were not present.
Expected Results:
The software should have interpreted the relative URL's in the dynamically
generated pages based upon the location of the HTML or JS document from which
the page was launched, in order to locate/load the relevant includes.
Comment 1•19 years ago
|
||
Not a CSS issue; it's just a matter of what the base URI of the document is....
Assignee: dbaron → general
Component: Style System (CSS) → DOM
Whiteboard: DUPEME
I'll dupe it against the newer one as that got testcases etc.
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → DUPLICATE
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•