RegisterClientScriptBlock Error

M

MW

I am trying to register the follow script through the
RegisterClientScriptBlock method. When the page loads it tells me that the
line contain <script language=javascript> is expect ;. Why would it be
expecting " ;" ? How do I correct this problem?

<script language=javascript>
var dynimages = New Array();
dynimages[0]=['Images/thumbstormfnsh.jpg', 'http://www.cnn.com'];
dynimages[1]=['Images/thumbstormie.jpg', 'http://www.yahoo.com'];
dynimages[2]=['Images/thumbuoBuddies.jpg', 'http://www.google.com'];
</script>

Michael
 
D

David Jessee

change your opening block to....

<script language="javascript">

that should fix it
 
A

avnrao

i tried out your sample with a small change.
var dynimages = new Array() // changed New to new.
it works.

Av.
 
M

MW

Thank you,

I didn't even realize that I had "new" capitalized.

Michael

avnrao said:
i tried out your sample with a small change.
var dynimages = new Array() // changed New to new.
it works.

Av.

MW said:
I am trying to register the follow script through the
RegisterClientScriptBlock method. When the page loads it tells me that
the
line contain <script language=javascript> is expect ;. Why would it be
expecting " ;" ? How do I correct this problem?

<script language=javascript>
var dynimages = New Array();
dynimages[0]=['Images/thumbstormfnsh.jpg', 'http://www.cnn.com'];
dynimages[1]=['Images/thumbstormie.jpg', 'http://www.yahoo.com'];
dynimages[2]=['Images/thumbuoBuddies.jpg', 'http://www.google.com'];
</script>

Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top