/    Sign up×
Community /Pin to ProfileBookmark

CSS not consistently showing with JavaScript generated HTML

Hi,

I was wondering if anyone could help with a problem I have…

I have a poppup calendar for date selection in a web application I’m involved in developing. All the html in the poppup is generated on the fly via JavaScript.

When I had this control as a poppup window it would always display correctly. However I recently converted the code to work as a drop-down iframe instead of a poppup window. It works well apart from the fact that usually on it’s first appearance (and sometimes subsequently) the css file is not being honored and the html is being displayed without it’s formatting. If the iframe is refreshed manually the css comes into affect.

Some facts that may help?!? …

1) This is for IE 6+ (we don’t support other browser types as it’s an internal application only).
2) The css file is referenced as a relative path:
<link rel=”stylesheet” href=”..StylesDatePicker.css” type=”text/css”>

Any help or suggestions would be greatly appreciated.

Cheers,
Gavin ?

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@gavinharrissauthorMar 01.2006 — No worries...

Found that if I call [frame].location.reload() from the calling page immediately after displaying the calendar then it seems to resolve the lack of css issue.

Cheers,

Gav ?
×

Success!

Help @gavinharriss spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...