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 7654725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:19:48+00:00 2026-05-31T12:19:48+00:00

I have a script embedded in a page, which is as follows: <script type=text/javascript>

  • 0

I have a script embedded in a page, which is as follows:

<script type="text/javascript">

function fireNlPopup()
{
    setOpacity(0);
    centre();
    document.getElementById("NlPopup").style.display = "block";
    fadeInNlPopup();
}

//Other functions here

</script>

this makes the following appear as a popup in-window:

<div id='NlPopup' name='NlPopup' class='nl'>
<table width='380' cellpadding='0' cellspacing='0' border='0'>
<tr>
<td><img height='23' width='356' src='images/x11_title.gif'></td>
<td><a href='javascript:fadeOutNlPopup();'><img height='23' width='24' src='images/x11_close.gif' border='0'></a></td>
</tr>
<tr><td colspan='2' style='background: url("images/x11_body.gif") no-repeat top left; width: 380px; height: 277px;'>
Your next lecture is X, with Y, at Z.
</td></tr>
</table>
</div>

and finally, this is all called by a button:

<button type="button" style="button" onClick="fireNlPopup()">Next Lecture</button>

The problem is when I try and put the script is a different file. I have a file, called popup.js, with the exact same code (since it works when embedded in my php file, i assumed if i copied it rote into a js file and called that, it would work.

When i call the js file, I use:

<script type="text/javascript" src="popup.js">
</script>

and then all the content between the script tags go into popup.js. However, despite the code working fine when it’s embedded, the second I take it out and put it in its own file, it doesn’t work. I’ve double and triple checked, my code works fine, is syntaxed correctly, and that’s why I left it out the code snippet. for some reason it just stops working. Am I calling the file incorrectly? It is on my server, I have checked that too =P

I’m probably being really stupid, but any help would be really useful. I’ve been stuck on this for ages.

Thanks =)

EDIT: for those who want a look, page is live here: http://oliverlea.com/3yp/tt.php

Also, using Chrome to view source, the file does load as a link.

Thanks for the help =)

EDIT 2:

First, yep the script tag is in the head of my file.

Second:
Ok, so regardless of whether I use src=”popup.js” “/popup.js” or “./popup.js” I get nothing. The url always loads in Chrome’s source viewer, and even by changing the permissions of the file to 0755, it still makes no difference.

I am completely flummoxed by this.

  • 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-31T12:19:50+00:00Added an answer on May 31, 2026 at 12:19 pm

    This is an encoding issue with the popup.js file. Please see below for my analysis. Some browsers “fix” this for you and others do not. The solution is to save popup.js file in standard encoding, on Windows machine try saving in Notepad.

    EDIT: Added summary (above). Complete analysis of your problem is below:

    Your page works in IE9, but not in Chrome or Firefox. Further, I copied the page and your CSS and JS (but not images) into a local project and it works for me there as well (even in chrome and Firefox).

    I then loaded your live page into FireFox and opened FireBug, and when I clicked “Next Lecture”, the console showed me that FireNlPopup is undefined.

    On further review, I went to view source in FireFox on your live page, and clicked “popup.js”
    The result looked like this:
    popup.js source view in firefox

    It seems like you are using a text editor of some sort to create your popup.js file which is encoding in a weird format; use standard Notepad or Notepad++, (i.e., not Wordpad) or use Eclipse or Visual Studio to save the popup.js file, and you should be good.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following jQuery function embedded in an MVC Razor page: <script type=text/javascript>
I have Drag/Drop functionality in my page embedded using YAHOO.js which is initalized at
We have several fairly large JavaScript files embedded into a single script resources DLL.
I have this simple javascript function which changes the body zoom of the web
I have applet embedded in http page. Applet is signed (as all jars which
I have an HTML page which contains an Object tag to host an embedded
i have an ajax for submit script on my html page, which loads a
How do I have a PowerShell script embedded within the same file as a
I have a compiled .NET assembly with a specific resource file embedded (named 'Script.xml').
I have a webpage which lags while loading, because an embedded object is trying

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.