BV Commerce Forum
»
BV Commerce Support
»
Development
»
How to reference a .js file in a custom theme?
Rank: Member
Joined: 6/11/2007(UTC) Posts: 12
|
I'm using the below in a custom master page for a theme I'm developing ... but it ain't pulling the .js file down in IE:
<!--[if lt IE 7.]> <script defer type="text/javascript" src="./scripts/pngfix.js"></script> <![endif]-->
Do I need to reference the .js file differently because of the conditional inclusion???
thanks - wayde
|
|
|
|
Rank: Member
Joined: 5/24/2004(UTC) Posts: 4,147
|
The issue is probably with the relative path of your script. .Net takes care of the CSS link path in your master page, but not js stuff. Is your scripts folder in your theme? If so, you can do something like this: Code:<!--[if lt IE 7.]> <script defer type="text/javascript" src="[b]<%# ResolveClientUrl("scripts/pngfix.js") %>[/b]"></script> <![endif]--> Then, in your masterpage's code-behind, add this: Code:Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load [b]Me.Page.Header.DataBind()[/b] End Sub There are other ways to do this, but this seems to be the easiest so far. |
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.