0

I have been using the code below for several years in my ASP.NET VB website. All of the sudden I am getting the following error:

Uncaught SyntaxError: Unexpected token (

Code From Master Pager Code Behind:

MyJavaScript = "<script language='javascript'>function(){getElementByName('MyLabel').style.display = 'none';</script>"
Page.ClientScript.RegisterStartupScript(Me.GetType(), "onload", MyJavaScript)

Rendered In Browser As:

<script language='javascript'>function(){getElementByName('MyLabel').style.display = 'none';</script>

1 Answer 1

2
MyJavaScript = "<script language='javascript'>function(){getElementByName('MyLabel').style.display = 'none';}</script>"
    Page.ClientScript.RegisterStartupScript(Me.GetType(), "onload", MyJavaScript)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.