?
Solved

JS Error - "Unexpected Identifier"

Posted on 2003-03-12
8
Medium Priority
?
743 Views
Last Modified: 2010-05-18
I have the following code:

<script src="<servername>/sametime/stlinks/stlinks.js"></script>
<script>setSTLinksURL("<servername>","en-us");</script>
<script>writeSTLinksApplet("<username>","", "1"); </script>
<script>writePlaceCounter("SameTimeTest","SameTime");</script>

<script>
function STLinksLoggedIn("<username>","<name>")
{
STLinksEnterPlace("SameTimeTest");
}
</script>

Whenever I run the code, I get the JS Error "Unexpected Identifier" and the line number it points to is the last <script>

I have tried everything I can think of, any ideas?
0
Comment
Question by:GaryZ
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 14

Expert Comment

by:avner
ID: 8118889
You have different JS errors :

Fix the function to :
<script>
function STLinksLoggedIn(username,name)
{
STLinksEnterPlace("SameTimeTest");
}
</script>

All other occurnces of "<servername>" should be your server name and not this string.
for example :
<script src="<servername>/sametime/stlinks/stlinks.js"></script>
to :
<script src="http://www.ayhoo.com/sametime/stlinks/stlinks.js"></script>
0
 
LVL 12

Expert Comment

by:ahosang
ID: 8118940
give us a link, or try running it with nescape and type
javascript:
in the address bar;
0
 

Author Comment

by:GaryZ
ID: 8119019
I know that, I changed the actual server name to <servername>.

I cannot give you a link, it is a secured application.
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 14

Expert Comment

by:avner
ID: 8119076
And you also change the method ?

If it still does not work, you'll have to post the whole code, if the problem is not in the posted code, there is no way we can trace the problem.
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 8119290
Hello Garry,

this line:
function STLinksLoggedIn("<username>","<name>")

is a function DEFINITION statement.

You can not put constants as function parameter.
It has to be parameter names without quotas.

Try this:
function STLinksLoggedIn()
{
STLinksEnterPlace(SameTimeTest);
}



Good luck,
Zvonko
0
 

Author Comment

by:GaryZ
ID: 9083046
The solution was a corrupted database, I had to restore it.
0
 
LVL 16

Expert Comment

by:jaysolomon
ID: 10130090
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

PAQ with points refunded

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jAy
EE Cleanup Volunteer
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 10215239
PAQed, with points refunded (500)

Computer101
E-E Admin
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question