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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:14:24+00:00 2026-06-14T04:14:24+00:00

I have a problem where my javascript is not working in a separate file,

  • 0

I have a problem where my javascript is not working in a separate file, but it is working inline.

This is the working code with my javascript in line. This is in asp.net 4.0.

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="FrontEnd.master.cs"   Inherits="pigninja.FrontEnd" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script type="text/javascript">
    function ShowItem(itemID) {
        document.getElementById(itemID).style.visiblity = "visible";
    }

    function HideItem(itemID) {
        document.getElementById(itemID).style.visiblity = "hidden";
    }
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Pigninja Paradox</title>
    <link href="../Styles/Styles.css" rel="Stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div id="pageWrapper">
        <div id="header">
        </div>
        <div id="navigation">
            <div id="menu">
                <ul>
                    <li><a href="../Default.aspx">Home</a></li>
                    <li><a href="../About.aspx">About Me</a>
                        <div id="submenu">
                            <ul>
                                <li onmouseout="HideItem('submenu');" onmouseover="ShowItem('submenu');"><a href="1983.aspx">
                                    1983</a></li>
                                <li><a href="1988.aspx">1988</a></li>
                                <li><a href="1990s.aspx">1990's</a></li>
                                <li><a href="2000.aspx">2000</a></li>
                                <li><a href="present.aspx">Present</a></li>
                            </ul>
                        </div>
                    </li>
                    <li><a href="../Programming.aspx">Programming</a></li>
                    <li><a href="../Rants.aspx">Rants</a></li>
                </ul>
            </div>
        </div>
        <div id="content">
            <asp:ContentPlaceHolder ID="Content" runat="server">
            </asp:ContentPlaceHolder>
        </div>
        <div id="footer">
            <p>
                I'd rather be an outlaw then to fall to Babylon law</p>
        </div>
    </div>
    </form>
</body>
</html>

The problem is as soon as I change this to

<script language="javascript" type="text/javascript" src="../scripts/navBarScript.js">  </script>

My code no longer works and I can’t for the life of me figure out why.

  • 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-06-14T04:14:25+00:00Added an answer on June 14, 2026 at 4:14 am

    I’m not sure why this fixed it, but I ended up changing my script to

    function ShowItem(itemID){
    document.getElementById(itemID).style.display = "block";
    }
    
    function HideItem(itemID){
    document.getElementById(itemID).style.display = "none";
    }
    

    After these changes my code performed as expected. I do not know how or why. But this resolved my issue.

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

Sidebar

Related Questions

I'm have a problem with this code not working when it probably should be:
I have two problem, This nestedSortable is not working in this code, where's the
I have this problem of an image rollover javascript not working in Internet Explorer
I have a problem with JavaScript magic. When I execute this code: var page
I have problem with variable printing inside javascript. variable htmlString printing not working: document.write(htmlString)
I Have the below Asp.net Code: the problem is that When Timer Tick Every
I have problem to put my own Javascript in a separate file and use
I have a problem with the click function in javascript. This is my code:
I have problem with javascript code. I am using google maps and I am
I have a problem with a javascript set of functions that I made. This

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.