[Javascript] Code optimization

Terry Riegel riegel at clearimageonline.com
Mon Aug 7 20:33:49 CDT 2006


> At 03:52 PM 8/7/2006, Terry Riegel wrote:
>> I appreciate your help and the general guidelines you are presenting.
>> I am not trying to ignore them or disregard your advise. I am just
>> not at that level in my Javascript programming. Actually moving my
>> Javascript out of my HTML was part of my original question. I thought
>> I would simplify my question as an aid to my learning, however the
>> only solution I received was one I had already found via google. That
>> being parentNode. However this returns UNDEFINED. Here is the exact
>> code I am referring to. If you would like the larger context, I am
>> building a web based file manager, and my HTML is being
>> programmatically generated.
>>
>>
>> Test otherstuff
>>
>> I would be very interested in how to convert the above snip to not
>> use inline scripting. btw. I prefer inline scripting when testing as
>> I dont have to worry about external files being cached and wondering
>> why my code changes are not working. However once I get things
>> working I dont mind moving everything to an external library.
>
>
> Hi Terry,
>
> Please don't try to include HTML and active script in your  
> listserve posting.  Eudora gives me an incomplete rendering with  
> scripting disabled -- as I would expect of an email client that  
> protects its users from attack.
>
> Instead, please post a page online and give us the URL so we can  
> see your markup and script in situ.
>
> Once I see your page, I'll probably be able to make a specific  
> scripting recommendation.
>
> You may feel modest about your javascript abiities at this time,  
> but frankly I think inserting bits of javascript inline into HTML  
> tags is harder and much more complicated than separating script  
> from markup.
>
> Warm regards,
> Paul

Fair enough, You can look at my problematic code at:
http://clearimageonline.com/projects/latechjs/alertparentdiv.html

I do think that for posterity there should be a mechanism for  
including the script inline as someone may be reading this a year  
from now and the link may be long gone by then. It is sort of  
meaningless without the code, but I do understand your concerns.

As far as inserting bits of javascript inline I am sure you are 100%  
correct, but that is little help in getting it from the inline copy  
to the alternative without some sort of example. If I dont know how  
to do it then the more difficult way remains the only vantage I have  
for learning how to do it the right way.

Thanks for you patience and consideration with me on this.

Terry Riegel




More information about the Javascript mailing list