473,386 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Optimize My Javascript

I create most of my javascripts by modifying others, therefore, I do
not have a vast knowledge of it and my question may seem trivial but
please help me.

If you go to my page http://www.dcs-chico.com/~denmarks/relative.html
you can see a simple script that uses the index returned from two pull
down menus to extract text from a table. I am looking for the best way
to display the result. I am currently using a text input form which
works but does not seem to be the best option. I would rather just have
the text appear directly on the page (without redrawing the page) and
not within a text box. Another problem is that even though the box is
read only, if someone places the curser in the box and presses return a
file not found message appears.

--
Dennis M. Marks
Do not reply with e-mail to yahoo. I do not monitor mailbox. It is for
collecting spam.
You can use the following address (rot 13) qr******@qpfv.arg
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 20 '05 #1
2 1598
"Dennis M. Marks" <de******@yahoo.com> writes:
If you go to my page http://www.dcs-chico.com/~denmarks/relative.html ....
I am currently using a text input form which works but does not seem
to be the best option. I would rather just have the text appear
directly on the page (without redrawing the page) and not within a
text box.
I think it looks fine. It is also the most compatible way of adding
information to a page. Other methods are:
- Netscape 4 layers
- IE 4+ innerHTML
- W3C DOM node manipulation (IE 5+,Mozilla, Opera 7, etc.)
- Iframe and document.write to it (don't know exactly which browsers).
No browser supports all of these, and none of these methods are supported
by all browsers.
Using a text input element works in all of these browser and more. In
some browsers, it is the *only* way to add content after the page has
loaded.
So, if you really want to use another method, you must tell us which
browsers needs to be supported. Then we can tell you how to do it.
(There is something about it in the FAQ too:
<URL:http://jibbering.com/faq/#FAQ4_15>)

If it looks so bad, style it:
<style type="text/css">
#output {
background: #0ff;
border:0px solid #0ff;
font: inherit;
}
</style>
and give the output field id="output". That should make it look like normal
text in those browsers that allow it.
Another problem is that even though the box is read only,
if someone places the curser in the box and presses return a file
not found message appears.


Your form element is generally not necessary if you don't want to
submit the form anyway. However, Netscape 4 only allows form controls
inside a form element, and it makes addressing the controls much easier.

A typical sign that you don't use the form element for submitting is
that you don't know what to write in the "action" attribute. You have
written "post", which should really be in the "method" attribute. The
"action" attribute should contain an URL.

If you don't have access to server side scripting, so you could make
the application work even if the client have no Javascript available,
I would let the "action" URL point to a page that explains that the
page needs Javascript to work. Then I would add an onsubmit handler
that prevented the form from being submitted if Javascript is available.
I.e.,
<form id="form" name="form"
method="post" action="noJS.html" onsubmit="return false">

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2
In article <d6**********@hotpop.com>, Lasse Reichstein Nielsen
<lr*@hotpop.com> wrote:

<SNIP>
I think it looks fine. It is also the most compatible way of adding
information to a page. Other methods are:
- Netscape 4 layers
- IE 4+ innerHTML
- W3C DOM node manipulation (IE 5+,Mozilla, Opera 7, etc.)
- Iframe and document.write to it (don't know exactly which browsers).
No browser supports all of these, and none of these methods are supported
by all browsers.
Using a text input element works in all of these browser and more. In
some browsers, it is the *only* way to add content after the page has
loaded.
So, if you really want to use another method, you must tell us which
browsers needs to be supported. Then we can tell you how to do it.
(There is something about it in the FAQ too:
<URL:http://jibbering.com/faq/#FAQ4_15>)

<SNIP>

Thanks, that helped a lot.

--
Dennis M. Marks
Do not reply with e-mail to yahoo. I do not monitor mailbox. It is for
collecting spam.
You can use the following address (rot 13) qr******@qpfv.arg
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andreas Falck | last post by:
Hi, I ran the code below on two different versions, 4.0.14 and 4.0.16 respectively, both running RH 7.3 on intel. In version mysql server version 4.0.14 the SELECT privelege suffices for...
9
by: Julie | last post by:
Due to circumstances beyond my immediate control, I've been put in charge of getting some JavaScript code in place and operational ASAP. Normally, I'm a C++ programmer, and previously have only...
0
by: Daniel | last post by:
Hi there, I recently came across an interesting option when right clicking on a project (Right click on the project -> properties -> Configuration Properties ->Build -> Optimize) There is an...
6
by: Silly | last post by:
byte Name = new byte; uint len = (uint)Name.Length; uint err = MyFunction(devID, out Name, out len); When this code is run in release build with optimize code set to true, len is evaluated to...
3
by: Reddy | last post by:
The sql query for my datagrid returns 100, 000 records. But the datagrid should display 20 records per page. I am using datagrid paging, but it is taking too much time for the page to load. Is...
3
by: Sonnich | last post by:
While trying to shorten my files, I tried optimize table - later I found that I need: mysqlcheck -u root -p[password[ --all-databases --analyze --optimize (thanks to Markus Popp). But it...
4
by: Huaer.XC | last post by:
>From the following MySQL command: EXPLAIN SELECT * FROM t1 JOIN t2 ON (t1.id = t2.id) JOIN t3 ON t3.name = t1.name WHERE t1.id IN(123, 124); which result is:...
15
by: kenneth | last post by:
I was trying to use multiple thread to optimize my following code, but met some problems, anyone can help me? k are initialized. int computePot() { int i, j; for( i=0; i<500; i++ ) { for(...
0
gits
by: gits | last post by:
This little article will show you how to optimize runtime performance when you need to compare two arrays (a quite common task). Have a close look at the entire article, and you will see the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.