Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Syntax Help - ASP.NET & javascript

Reply
Thread Tools

Syntax Help - ASP.NET & javascript

 
 
Mike
Guest
Posts: n/a
 
      03-09-2008
Hi. I have a unique problem. I have some HTML which displays correctly when
I input it into an aspx page or html page. But when I use javascript's
document.write() to write the html directly to the page, I get a script
error. The nature of the program requires me to use document.write() instead
of simply typing html directly.

The html is pretty simple - It's just a table. I've uploaded the page below
so you can see it...
www.masonsolutions.net/testing/page.html

As you can see, it looks fine here as regular HTML. But when I use
document.write() I get a script error saying "Syntax Error Expected ')'".

Could someone please let me know why this script error occurs when I use
document.write? This is an asp.net project, and I know someone here can
provide an answer, which is why I've posted here; please let me know if I
should post elsewhere.

Thanks!
 
Reply With Quote
 
 
 
 
Mark Rae [MVP]
Guest
Posts: n/a
 
      03-09-2008
"Mike" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> As you can see, it looks fine here as regular HTML. But when I use
> document.write() I get a script error saying "Syntax Error Expected ')'".
>
> Could someone please let me know why this script error occurs when I use
> document.write?


Well, at the risk of stating the blindingly obvious, it occurs because
you've missed a closing bracket somewhere...

Do a View Source and inspect the generated JavaScript...


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

 
Reply With Quote
 
 
 
 
Mike
Guest
Posts: n/a
 
      03-09-2008
I've already done so, and there are no missing brackets.

"Mark Rae [MVP]" wrote:

> "Mike" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
> > As you can see, it looks fine here as regular HTML. But when I use
> > document.write() I get a script error saying "Syntax Error Expected ')'".
> >
> > Could someone please let me know why this script error occurs when I use
> > document.write?

>
> Well, at the risk of stating the blindingly obvious, it occurs because
> you've missed a closing bracket somewhere...
>
> Do a View Source and inspect the generated JavaScript...
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net
>
>

 
Reply With Quote
 
Mark Rae [MVP]
Guest
Posts: n/a
 
      03-09-2008
"Mike" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

>> > As you can see, it looks fine here as regular HTML. But when I use
>> > document.write() I get a script error saying "Syntax Error Expected
>> > ')'".
>> >
>> > Could someone please let me know why this script error occurs when I
>> > use
>> > document.write?

>>
>> Well, at the risk of stating the blindingly obvious, it occurs because
>> you've missed a closing bracket somewhere...
>>
>> Do a View Source and inspect the generated JavaScript...

>
> I've already done so, and there are no missing brackets.


If you're absolutely certain about that, I would suggest building up the
JavaScript a bit at a time until you find the line with the missing
bracket... It may not be where you think it is...


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

 
Reply With Quote
 
Peter Bromberg [C# MVP]
Guest
Posts: n/a
 
      03-10-2008
There is an HTML-->Javascript converter form on this article page:

http://www.eggheadcafe.com/articles/20060517.asp

Paste your HTML into the top textarea, press the button, get correct
Javascript in the bottom. View source on the page to get the code to make
your own.

-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short Urls & more: http://ittyurl.net


"Mike" wrote:

> Hi. I have a unique problem. I have some HTML which displays correctly when
> I input it into an aspx page or html page. But when I use javascript's
> document.write() to write the html directly to the page, I get a script
> error. The nature of the program requires me to use document.write() instead
> of simply typing html directly.
>
> The html is pretty simple - It's just a table. I've uploaded the page below
> so you can see it...
> www.masonsolutions.net/testing/page.html
>
> As you can see, it looks fine here as regular HTML. But when I use
> document.write() I get a script error saying "Syntax Error Expected ')'".
>
> Could someone please let me know why this script error occurs when I use
> document.write? This is an asp.net project, and I know someone here can
> provide an answer, which is why I've posted here; please let me know if I
> should post elsewhere.
>
> Thanks!

 
Reply With Quote
 
Mike
Guest
Posts: n/a
 
      03-10-2008
I'm not infront of my development machine now, but this looks promising and I
wanted to say thank you for pointing me here. I can't wait to try it!

"Peter Bromberg [C# MVP]" wrote:

> There is an HTML-->Javascript converter form on this article page:
>
> http://www.eggheadcafe.com/articles/20060517.asp
>
> Paste your HTML into the top textarea, press the button, get correct
> Javascript in the bottom. View source on the page to get the code to make
> your own.
>
> -- Peter
> Site: http://www.eggheadcafe.com
> UnBlog: http://petesbloggerama.blogspot.com
> Short Urls & more: http://ittyurl.net
>
>
> "Mike" wrote:
>
> > Hi. I have a unique problem. I have some HTML which displays correctly when
> > I input it into an aspx page or html page. But when I use javascript's
> > document.write() to write the html directly to the page, I get a script
> > error. The nature of the program requires me to use document.write() instead
> > of simply typing html directly.
> >
> > The html is pretty simple - It's just a table. I've uploaded the page below
> > so you can see it...
> > www.masonsolutions.net/testing/page.html
> >
> > As you can see, it looks fine here as regular HTML. But when I use
> > document.write() I get a script error saying "Syntax Error Expected ')'".
> >
> > Could someone please let me know why this script error occurs when I use
> > document.write? This is an asp.net project, and I know someone here can
> > provide an answer, which is why I've posted here; please let me know if I
> > should post elsewhere.
> >
> > Thanks!

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax Checker that's better than the normal syntax checker Jacob Grover Ruby 5 07-18-2008 05:07 AM
Syntax error? What syntax error? Assignment fo default values? Mark Richards Perl Misc 3 11-18-2007 05:01 PM
Syntax bug, in 1.8.5? return not (some expr) <-- syntax error vsreturn (not (some expr)) <-- fine Good Night Moon Ruby 9 07-25-2007 04:51 PM
[ANN] SqlStatement 1.0.0 - hide the syntax of SQL behind familiarruby syntax Ken Bloom Ruby 3 10-09-2006 06:46 PM
Syntax highligth with textile: Syntax+RedCloth ? gabriele renzi Ruby 2 12-31-2005 02:44 AM



Advertisments