473,670 Members | 2,538 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.a rg
-----= 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 1609
"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.ht ml" onsubmit="retur n false">

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2
In article <d6**********@h otpop.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.a rg
-----= 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
1789
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 "optimize table", but (seemingly) the server version 4.0.16 requires INSERT as well. Is the INSERT privelege necessary for performing optimize in mysql
9
1461
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 barely fiddled w/ JS. The good news is that I have been able to get through the JS coding and everything is working as expected; the bad news is that it doesn't perform as well as I'd like. I feel that the performance problems that I'm...
0
2006
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 option in there to optimize the code, has anyone had any expeiance / problems with this option and were there any significant gains in performance by turning on this setting?
6
1528
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 0. If it is run with optimize code set to false, len is evaluated as 256 (what i want). If I add an extra line of code after declaring len, like:
3
2820
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 there any way I can optimize the speed. Any sample code would be great. Thanks, Reddy
3
4947
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 gives this error: mysqlcheck: Got error: 1044: Access denied for user 'root'@'localhost' to database 'information_schema' when executing 'OPTIMIZE TABLE ... '
4
2020
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: ------------------------------------------------------------------------------------- table type possible_key key key_len ref rows Extra t1 const PK, name PK 4 const 10 t3 const PK PK 4 const 10
15
2517
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( j=0; j<i-1; j++ ) {
0
38200
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 advantage of the final code snippet :) Let's assume we want to find out the element that is contained by both of the lists. var list1 = ; var list2 = ; for (var i in list1) { for (var j in list2) {
0
8466
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8384
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8591
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7412
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6212
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4388
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2799
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2037
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1791
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.