Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 404657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:19:42+00:00 2026-05-12T17:19:42+00:00

Although this question have been asked and answered before, including on this website, I

  • 0

Although this question have been asked and answered before, including on this website, I am not managing to solve my problem.

I am using Masterpages, and Javascript files… and everyone now how “tricky” masterpages get with relative paths…

Well, I am using a png fix called: unit Png Fix (quite good to be honest… even better than the JQuery one), and this fix needs to use a small image called clear.gif.
The path to the clear.gif file is being stored inside a variable that is in the JavaScript file.

However, and since I am using Masterpages I cannot simply open the JS File and write a static path… has i thought.

What I tried was: remove the variable from the JS File, and declare it outside, but in the sabe Script block. Like this:

 <!--[if lt IE 7]>
        <script src="<%= ResolveClientUrl("~/masterpages/js/unitpngfix.js") %>" type="text/javascript">
            var clear="<%= ResolveClientUrl("~/masterpages/img/clear.gif") %>";
        </script>
<![endif]-->

I even tried to declare it in the Head of the website. (I’m placing my JS files at the bottom of my page, to speed it up).

Unfortunately my solutions didn’t work… which is why i am doing this question here. 🙁

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T17:19:42+00:00Added an answer on May 12, 2026 at 5:19 pm

    You can’t declare a src and content in a single element.

    from the script element definition on the W3C site:

    If the src has a URI value, user agents must ignore the element’s contents and retrieve the script via the URI

    Try separating them:

    <script type="text/javascript">
        var clear="<%= ResolveClientUrl("~/masterpages/img/clear.gif") %>";
    </script>
    <script src="<%= ResolveClientUrl("~/masterpages/js/unitpngfix.js") %>" type="text/javascript"></script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question may have been asked already - but unfortunately, I could not find
I know this question has been asked before but I have a design question
It looks like this question has been asked before, here and in other places
I have a HashMap (although I guess this question applies to other collections) of
Although somewhat related to this question , I have what I think is a
I admit this is not strictly a programming question, although I do use my
Perhaps this question has been asked elsewhere, but I'm unable to find it. With
First of all I'm sorry if you feel this question has been raised before,
Although this question and this question are close to what I'm asking, I believe
I've actually asked about this already in this post although we've gone back to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.