[prev in list] [next in list] [prev in thread] [next in thread] 

List:       slashcode-general
Subject:    Re: [Slashcode-general] Why JS errors on topic admin page?
From:       Shane <shane () lottadot ! com>
Date:       2004-12-11 13:33:15
Message-ID: 36364AAC-4B79-11D9-A05A-000A95DBD7A6 () lottadot ! com
[Download RAW message or body]

I've seen no errors. Infact, with the re-designed interface and newest 
code, I was quite impressed with it all.

I've used Safari 1.2.4 and Moz 1.7.2 with it, neither had problems. 
(I'm running CVS-current from this past Monday, or Tuesday, I don't 
remember which day I upgraded).

I'd file a bug report on SF, if I were you.

  Shane



On Dec 10, 2004, at 4:23 PM, Gaulin, Mark wrote:

> Hello again,
> I'm seeing lots of JS errors on the Topic admin page (using latest CVS 
> stuff).  Read on to see what I ran into, but my real question is Does 
> anyone else see lots of JS errors on the Topics admin page, or do I 
> have an installation problem?
>
> --
>
> The very first error happens as the page loads, and that I think is 
> caused by the order of some stuff in the 
> "topic_popup_ui_topiced;admin;default" template.
>
> On FireFox the js error console says "myselect has no properties" in 
> source file /admin-topic-popup.js, which is in the function 
> "st_load_names()"
>
> (this is from a View Source of the page)
> function st_load_names() {
> 	var myselect = document.slashstoryform.st_main_select;
>
> 	// the error is right here... the object myselect is not set
> 	if (myselect[0]) {
> 	...
> ...
> }
>
> (IE gives a similar error.)
>
> The object document.slashstoryform.st_main_select is defined in the 
> "topic_popup_ui_topiced;admin;default" template on line 31:
>
> (this is from a View Source of the page, but it corresponds to line 31 
> from the template)
>
> <select name="st_main_select" size=10 multiple 
> onchange="st_select_weight()" onfocus="st_change_focus('st')">
> <option value="-30">-^- Mainpage -^-</option>
> <option value="-10">-^- Sectional -^-</option></select>
>
> The problem is that st_load_names() is being called on the page before 
> the <select name="st_main_select"> above is processed, so of course it 
> doesn't exist.  (It's being called from line 45 of the template.)
>
> I tried the obvious thing and edited the template, moving the JS code 
> down after the <select> tag.  This caused a different JS error when 
> the page loads (stc_reset_saved_tree is not defined), so I decided to 
> slow down a bit, an undid my edits.
>
>
> My next attempt, which I think is a decent one, was to change the 
> site/mysite/admin-topic-popup.js file so that the missing object will 
> not be referenced. I added the "(myselect != null) && " bit below...
>
> function st_load_names() {
> 	var myselect = document.slashstoryform.st_main_select;
>
> 	if ((myselect != null) && myselect[0]) {
> 		myselect[0].selected = true;
> 	}
> }
>
> This worked, and now IE and FireFox can load the page without errors. 
> (I didn't mess with the templates at all, since I'm just hacking 
> around at this point, and I don't know exactly how the .js files get 
> built from the topic_popup_js template.)
>
> Now the only error I see is for undefined st_select_weight() and 
> stc_select_weight() functions (called by the <select> tag's onchange 
> event).  I added empty versions of those two functions to the same 
> admin-topic-popup.js file and now the Topics pages doesn't generate 
> any errors, and it even works in IE.
>
> So, back to my main question:  Why did I have these problems in the 
> first place? Is my build (created from CVS yesterday) broken?
>
> Thanks
> 	Mark
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real 
> users.
> Discover which products truly live up to the hype. Start reading now.
> http://productguide.itmanagersjournal.com/
> _______________________________________________
> Slashcode-general mailing list
> Slashcode-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/slashcode-general
>



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Slashcode-general mailing list
Slashcode-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/slashcode-general
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic