Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

Syntax Help - ASP.NET & javascript

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike - 09 Mar 2008 05:17 GMT
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!
Mark Rae [MVP] - 09 Mar 2008 05:22 GMT
> 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...

Signature

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

Mike - 09 Mar 2008 05:32 GMT
I've already done so, and there are no missing brackets.

> > 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 ')'".
[quoted text clipped - 6 lines]
>
> Do a View Source and inspect the generated JavaScript...
Mark Rae [MVP] - 09 Mar 2008 12:50 GMT
>> > 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
[quoted text clipped - 10 lines]
>
> 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...

Signature

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

Peter Bromberg [C# MVP] - 10 Mar 2008 18:29 GMT
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

> 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
[quoted text clipped - 15 lines]
>
> Thanks!
Mike - 10 Mar 2008 22:11 GMT
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!

> There is an HTML-->Javascript converter form on this article page:
>
[quoted text clipped - 28 lines]
> >
> > Thanks!

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.