3,892 Posted Topics

Member Avatar for kevin wood

[code]<script type="text/javascript"> document.getElementsByName('rand')[0].value = document.getElementsByName('main')[0].src; </script>[/code] The function [ICODE]getElementsByName [/ICODE]returns a [ICODE]nodelist [/ICODE]i.e. an array of all the elements which go by that name. Hence the array indexing operator [ICODE][][/ICODE] is a must. If you are pretty sure that there is only one element on the entire page which goes …

Member Avatar for kevin wood
0
103
Member Avatar for fluffythebunny

If you want to share something good with the others out there, we have a [URL="http://www.daniweb.com/code/javascript.html"]code snippets section[/URL]. Threads posted in normal forums end up getting lost in the sands of time. ;-)

Member Avatar for fluffythebunny
0
73
Member Avatar for afflictedd2

The error "MyRemote cannot be resolved to a type." seems to be pretty straightforward; you need to include the 'MyRemote' class in your JSP for it to successfully compile. I know this advice would fall on deaf ears but avoid using scriptlets in your JSP's, put the application logic in …

Member Avatar for ~s.o.s~
0
93
Member Avatar for tanha

There is no [icode]navigate[/icode] function for the [icode]window[/icode] object. Maybe try something like: [code] <?php function reDirect($page) { $s = "<script language = 'javascript'> window.location.href = '$page'; </script>"; return $s; }[/code]

Member Avatar for ~s.o.s~
0
121
Member Avatar for mosh

> If I have a variable named X , and this virable hold some data , how can I know > the Type for that data The [I]typeof [/I]operator should make things a bit easier for you. Try this: [code] <script type="text/javascript"> var i = 0; alert(typeof i); // number …

Member Avatar for digital-ether
0
132
Member Avatar for mikki2

Your issue has got nothing to do with Javascript; it is handled when deploying your web application on the web server / container of your choice by means of a configuration file. Consult your web server's documentation for more details.

Member Avatar for mikki2
0
125
Member Avatar for sampathw

Place the block of Javascript code *after* the DIV tag and things should work out fine. It problems still persist, consider attaching a listener to the onload event handler of the window object which would execute the required Javascript only after the entire page has loaded.

Member Avatar for sampathw
0
119
Member Avatar for jk_bscomp

There are at least [URL="http://forum.java.sun.com/thread.jspa?threadID=642042&messageID=10137425"]millions of threads[/URL] out there providing a proper solution to the same problem; maybe doing a bit of research on your own would help you understand the way things work.

Member Avatar for peter_budo
0
979
Member Avatar for maui_mallard

[QUOTE=maui_mallard;559530]YEAH I Know... Ill be up to you in NO TIME[/QUOTE] You have already started your journey the 'Bennet way' it seems. [B]Hint: [/B]Your signature.

Member Avatar for jbennet
2
311
Member Avatar for priyala
Re: HTML

Please explain your problem in a better manner. If there is a server side processing involved when interacting with the HTML control, then yes, you can write whatever data is present in the form (plus something totally unrelated) to a text file which would be created on your server. When …

Member Avatar for allen.jes
0
87
Member Avatar for vganeshvenu

There are many free / open source Javascript calendars out there. Just key in 'Javascript calendar' in Google and you would be a few steps away from getting one...

Member Avatar for codebreaker
0
117
Member Avatar for katerinaaa

> But the program stops in the first null line. [inlinecode]null != empty_line[/inlinecode] A null returned signifies that a end of file has been reached and has got nothing to do with empty lines. Inside your loop, just check to see if [inlinecode]str.trim().length() != 0[/inlinecode] and write that line to …

Member Avatar for alpe gulay
0
5K
Member Avatar for Kusno

> but I dont know why JSP gives this result : Maybe because "KodeAlbum" actually contains "000002-0015"? It would be better if you printed out the value of the form field "KodeAlbum" after form submission and made sure it is the same as you want. If yes, then the change …

Member Avatar for ~s.o.s~
0
108
Member Avatar for hidash_in

What do you mean by 'open PDF' files using Javascript? You need the appropriate softwares for opening the respective files e.g. Acrobat reader for PDF files. The maximum you can do is make the browser open up a prompt box which would give you the option of either saving the …

Member Avatar for ~s.o.s~
0
179
Member Avatar for to.prakashg

This happens almost always due to Javascript errors and the Javascript on that page looks all messed up. Remember that IE is more forgiving and will automatically make up for your mistakes; Firefox won't. Your best bet would be to get your generated HTML validated, look for any glaring markup …

Member Avatar for Thirusha
0
143
Member Avatar for khyaniv24

Phew! Next time make sure you attach your code instead of dumping the entire 1.6K line thing on the message boards.

Member Avatar for Salem
-1
78
Member Avatar for Aeneassan

According to the HTML 4.01 specification: [quote]ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").[/quote] Plus NAME attribute is deprecated for *non-form* elements; use ID instead. And a better …

Member Avatar for ~s.o.s~
0
132
Member Avatar for RBA
Member Avatar for theausum
Member Avatar for web_master

You need to toggle the rendering and not visibility. Even invisible elements takes up space on the page. Use the "display" property to create invisible elements that do not take up space. [code]<div id="testDiv" style="display: none;">Content</div>[/code]

Member Avatar for web_master
0
106
Member Avatar for jetru

Your question would be more pertinent in the [URL="http://discuss.joyent.com/viewforum.php?id=20"]SIFR forums[/URL] than here.

Member Avatar for ~s.o.s~
0
62
Member Avatar for still_learning

> Ok so here is the code I am using and all I am getting is a blank page. A few things: - [ICODE]window.location[/ICODE] is a host object (browser object); what you probably need to do here is [ICODE]window.location.href = 'url'[/ICODE]. Even though the former works, it's an incorrect way …

Member Avatar for ~s.o.s~
0
99
Member Avatar for ambarish510

Look closely at the code you have written. The tag <jsp:param> doesn't have a body and hence should be written as one. Leaving them open is what is causing the problems here. It should be: (notice the slashes at the end of the param tag) [code] <jsp:params> <jsp:param name="textcolor" value="#FFFFFF" …

Member Avatar for ~s.o.s~
0
466
Member Avatar for Visualogic

Use[URL="http://www.mysql.com/products/connector/j/"] MySQL Connector J[/URL], a type 4 / pure JDBC compliant driver. Make sure you add this driver to your runtime dependency and you are good to go.

Member Avatar for ~s.o.s~
0
148
Member Avatar for Gunjan Bhatt

> I have tried my level best to complete the project within 2 months but I am not able to do > that. Maybe you looked in the wrong places; the internet is choke full of resources which can help you complete almost every school level project. You just need …

Member Avatar for ~s.o.s~
0
137
Member Avatar for kavithakesav

And replacing the [ICODE]onclick [/ICODE]with [ICODE]onmouseover [/ICODE]doesn't seem to work?

Member Avatar for kavithakesav
0
88
Member Avatar for Kusno

No matter what kind of tutorials you read, learning from a good book is almost always irreplaceable. For JSP/Servlets, Head First Servlets and JSP is a good choice IMO.

Member Avatar for ~s.o.s~
0
141
Member Avatar for priyadpratheep

Start off with the [URL="http://java.sun.com/javaee/reference/"]Sun J2EE tutorials[/URL] which cover almost everything you need to complete this project along with a lot of sample code.

Member Avatar for ~s.o.s~
0
70
Member Avatar for FrankThePostman

> You can't use getElementById to access elements added by a script. Bosh. Please verify the facts before stating something. [code] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv"Script-Content-Type" content="text/javascript"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Expires" content="0"> <!-- disable caching --> <title>Example</title> <script type="text/javascript"> function addElem(frm) { …

Member Avatar for ~s.o.s~
0
3K
Member Avatar for ertarunz7

So what seems to be the problem? Which method are you currently using for shipping data to-and-fro? XML, JSON or plain text? AFAIK, refreshing (updating) two DIV's shouldn't be very much different than refreshing a single DIV except for the way in which you request / handle the two new …

Member Avatar for ertarunz7
0
112
Member Avatar for abhijit_s_2000

How about showing us your effort or what you have achieved so far considering that we have a forum policy to not give out free code snippets? Also, please don't forget to read the forum rules and use code tags when posting code.

Member Avatar for ~s.o.s~
0
53
Member Avatar for adaykin

Initially attach a styleclass to all the links on your page which will keep them hidden using the [ICODE]display [/ICODE] / [ICODE]visibility[/ICODE] CSS property. Attach an event handler to the [ICODE]onload [/ICODE]event listener which would make these links visible only after the entire page has loaded, by virtue of the …

Member Avatar for ~s.o.s~
0
345
Member Avatar for Dani

I really don't mind them since I rarely hover on a thread to preview it. But on rare times when those things pop up, they are a little bit distracting; maybe because I am not used to them.

Member Avatar for ~s.o.s~
0
98
Member Avatar for The Dude
Member Avatar for sidemon

The snippet as such doesn't seem to reek of any bugs so your best bet would be to look at the place where [ICODE]usrPass[/ICODE] actually originates. Maybe it's the way you are accepting user input which is causing it to trim whitespaces. One minor point; instead of [ICODE]passCh == ' …

Member Avatar for sidemon
0
86
Member Avatar for lordx78

Where is the definition of the empty() function? It would be better if you posted a working copy of your code which we can directly use for testing your example rather than trying to figure out what seems to be wrong in the small snippet presented to us.

Member Avatar for lordx78
0
109
Member Avatar for swingingstars

> How can I fill the content with ajax responseText ONLY after the page structure has been fully > loaded? Attach a listener (function) to the onload event handler which would load all the values using Ajax requests only after the page has been loaded. > is it matters if …

Member Avatar for swingingstars
0
180
Member Avatar for sbv

You seem to be in serious need of some good [URL="http://www.jibbering.com/faq/faq_notes/form_access.html#faInF"]Javascript tutorials[/URL]. First of all, Javascript is case sensitive, hence [icode]selectedindex[/icode] is not the same as [icode]selectedIndex[/icode]. Also, the values of form controls are always of type string, so checking a textbox value for 0 seems pointless enough. It should …

Member Avatar for sbv
0
105
Member Avatar for hunkychop

To get around these scope issues, you can either go with the messier and error prone global object solution or make use of the elegant concept of Closures. [code] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv"Script-Content-Type" content="text/javascript"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Expires" content="0"> <!-- disable …

Member Avatar for ~s.o.s~
0
1K
Member Avatar for Jcw69

> my project uses JSF. JSF projects require a configuration file which goes by the name of faces-config.xml along with an entry of FacesServlet in the web.xml which does the actual processing of the JSF pages. You need to take care of these things when deploying a JSF app; but …

Member Avatar for jwenting
0
91
Member Avatar for AaronASterling

> Ok...when i change the line this.value = this.dummy(value) to this.value = > this.prototype.dummy(value) the code runs. Are you sure this works, because IMO it shouldn't. Try to instantiate your object in a normal manner and see this line blow up. The [ICODE]prototype [/ICODE]property of the object is not the …

Member Avatar for AaronASterling
0
183
Member Avatar for kickinmhl

You are doing a [ICODE]getElementById()[/ICODE] for "I1" but there is no element which goes by the ID "I1"; you only have an [ICODE]IFRAME [/ICODE]with a [ICODE]name [/ICODE]attribute of "I1". IE is infamous for allowing such things to slip by. If a call to [ICODE]getElementById()[/ICODE] returns [ICODE]null[/ICODE], it looks for an …

Member Avatar for ~s.o.s~
0
185
Member Avatar for tte

Forward won't work given that the requested servlet is looked for in the given ServletContext. [icode]sendRedirect[/icode] doesn't preserve the original request since it's a new request altogether which the client is making -- [icode]sendRedirect[/icode] is basically an indication to the client to request for the given URI.

Member Avatar for jwenting
0
143
Member Avatar for Aia

Just follow the golden rule of never using TABS in your source code along with following the 70/80 column limit by using good source code formatters and you should be good to go without having to rely on which algorithm is used to format/render your code.

Member Avatar for Aia
0
169
Member Avatar for jugo

Maybe something along the lines of this (untested) [code] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv"Script-Content-Type" content="text/javascript"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Expires" content="0"> <!-- disable caching --> <title>Example</title> <script type="text/javascript"> timerHandle = null; value = null; function showPress(val) { // Set the global variable 'value' …

Member Avatar for ~s.o.s~
0
124
Member Avatar for Gia
Member Avatar for HenryGR
0
154
Member Avatar for loboman

It is a bit fuzzy as to what you are trying to do here but as far as I can see, you need some way of automating the data which adds markers to the Javascript 'map' object on the fly by reading in data from some external XML file. One …

Member Avatar for ~s.o.s~
0
122
Member Avatar for ikabod1973

You can always make two server trips and pull the required information one at a time. Another way would be to use JSON to pull in data in a single server trip by sending the data in the form: [icode]{ city: ['C1', 'C2', 'C3'], state: ['S1', 'S2', 'S3'] }[/icode] and …

Member Avatar for ~s.o.s~
0
93
Member Avatar for WolfPack

IMO going all the way to convert tabs into spaces using some intelligent algorithm is way too much trouble than it's worth. It is basically the responsibility of the programmer posting the code to make sure that all tabs are converted to spaces and to follow the 80 column width …

Member Avatar for Dani
0
319
Member Avatar for Dani

> i dont know whether its to do with this, or a load of hotfixes i installed, but windows mobile > PDAs no longer crash when displaying threads It's the Hot fixes you installed, not Javascript.

Member Avatar for Dani
0
198

The End.