Print Page | Close Window

Javascript in ASP Loop?

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=22342
Printed Date: 08 April 2026 at 8:23am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Javascript in ASP Loop?
Posted By: Melkor
Subject: Javascript in ASP Loop?
Date Posted: 05 January 2007 at 7:28pm

I like to use Javascript navigation in my sites (I use Webstyle for this. Excellent software!) But I am encountering a problem with them when I use them within WWF 8.5.

The images appear, the drop down menu boxes appear, the mouse over effects all work as they should but the names within those menu boxes aren't happening despite the links still working.

Any clues?




Replies:
Posted By: iSec
Date Posted: 07 January 2007 at 8:48am

Do you have any link so we can see how it looks? It might be conflicting with the forum's style sheet.



Posted By: Melkor
Date Posted: 07 January 2007 at 9:06am
Hmmm, unfortunately not. I have it up in a locked forum.

Interestingly though, it works perfectly with FF, just IE that lets the side down (no surprise there)


Posted By: Melkor
Date Posted: 09 January 2007 at 2:30am
Ok, I put a Nav up. The menu displays correctly in FF but not in IE7, where none of the menu test appears.

http://www.lotrplaza.com/forum/forum_postsjs.asp?TID=212784 - http://www.lotrplaza.com/forum/forum_postsjs.asp?TID=212784

Could it be because the Navigation has it's own CSS and that is clashing with the WWF CSS?


Posted By: Melkor
Date Posted: 09 January 2007 at 7:14am
OK, more information inbound.

This line of code;

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


seems to be at the root of my issues.

If I put my Javascript in before that line, the Navigation works but the posts in the threads load incorrectly.
If I put the JS in after that line, the posts load correctly but the Navigation doesn't work correctly in the way detailed above.

Is there a DOCTYPE I can use and get what I want. Despite despising IE as the root of all of these issues I am having, the majority of my users use the afore mentioned browser. Thus and therefore, I need to get this right.


Posted By: WebWiz-Bruce
Date Posted: 09 January 2007 at 9:43am
If you are getting this error because of the docutype declaration that it suggests that your Javascript is not correctly formatted and you should look at fixing your javascript, if not you will have other issues as browser are increasingly being more standards compliment. 

-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: pjb007
Date Posted: 09 January 2007 at 4:53pm
What I tend to do with JavaScripts is place the text that goes between the <script> tags in a .js file, then link to them like this.
 

<script type="text/javascript" src="file.js">
</script>


Posted By: Melkor
Date Posted: 09 January 2007 at 9:15pm
Finally got around that issue. It was a problem with IE and CSS which I circumvented by re-writing the CSS of the menu into the main CSS file.

I have a new issue now.

The menu is only picking up info from the first post.
http://www.lotrplaza.com/forum/forum_postsjs.asp?TID=212777 - http://www.lotrplaza.com/forum/forum_postsjs.asp?TID=212777

I have droped the menu options down to just the lngMessageID to better demonstrate my problem and have also included the Message ID above the menu temporarily to better show how it should be.

I have in the JS;

var postID=<%=lngMessageID%>

and that works great, like I said, for the first post in the thread but the Javascript isn't looping with the ASP loop.


Posted By: ctscott
Date Posted: 10 January 2007 at 2:50pm
In IE on this link i get a javascript error on line 3387 - Invalid object.

-------------
______________________
http://www.cfbtrivia.com" rel="nofollow - College Football Trivia


Posted By: Melkor
Date Posted: 10 January 2007 at 10:47pm
I decided to say "screw it" to having it embedded in the post. Javascript isn't dynamic enough. I'll take the post controls to a pop-up window instead and carry the details through querstrings. The Common.asp should handle the rest.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net