• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 562
  • Last Modified:

ASP Master page Syntax Error load JQuery library

I am trying to load the JQuery library in my ASP.Net application. The obvious place to put it is in the Master Page.
I am using VS 2008, although the app was converted from 2005.
I cannot for the life of me understand what the syntax error is "On line 2" when I run the app.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
    <script src="JQuery/jquery-1.2.6.min.js" type="text/javascript"></script>
   <script language="javascript" type="text/javascript" >
function show(id) {
 document.getElementById(id).style.visibility ='visible';
 document.getElementById(id).style.color ='black';
function hide(id) { 
 document.getElementById(id).style.visibility ='hidden';

Open in new window

  • 2
  • 2
1 Solution
David H.H.LeeCommented:
Hi hijiki7777,
If the JQuery library is installed correctly("JQuery/jquery-1.2.6.min.js"), it should be ambiguous duplicate declared function name. Try rename these function - show(id) and hide(id) to others name. If not mistake, these 2 functions has been declared and used inside this library.
function showControl(id) {

function hideControl(id) {

hijiki7777Author Commented:
x com, thank you for that answer, it worked!
It really didn't occur to me that that could be the problem, and since it is the solution it is clearly a bit of a hazard when installing JQuery on a mature system. It really would have helped if the error message had been "ambiguous duplicate declared function name" instead of "syntax error".
Anyway, thank you very much, and useful to have that experience.
hijiki7777Author Commented:
I am SO grateful. A simple solution that did not occur to me.
David H.H.LeeCommented:
I'm glad to help. Cheers.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now