Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi everyone,
Does anybody know how to call a jsp script with a value in javascript?
I know there is a way to go to a different page, the syntax is
window.location.replace('jobedit.jsp?id="+intItemID+"&cmd=upfb');
but I need to stay in the same window and execute the script

This article may help. It is about calling a PHP script from JavaScript without actually loading a page. Don't see why it wouldn't work for JSP as well:
http://www.phpit.net/article/php-on-the-fly/
Michael J

ajax? I'm currently building one with it. It's so hard to make it work on IE, firefox & opera without understanding javascript's DOM (which I don't).
This is the tutorial I'm trying to implement, their example work on that 3 browsers: http://www.yourhtmlsource.com/javascript/ajax.html
The example page: http://www.yourhtmlsource.com/examples/ajaxformsubmission.html

Rasmus' 30 second AJAX Tutorial was my first tutorial :D A quick read if you just want to understand the conecpt, but it breaks my layout in opera.

and this is nice too :-D
http://mentalized.net/activity-indicators/
as most people will think there's something wrong when nothing happens when they click.

Well, at this point, I'm using javascript to do POST to my request processing jsp page. The issue now - I'm ready to send back data from that jsp page into the client view page and I'm not sure what has to happen on the client side to show the data.

You want to do it asynchronously right? Only some of the content changed, not the whole page? Take a look at the 30 second tutorial written by Rasmus above, you'll get a good grasp on what should be done.
I'm not sure what has to happen on the client side to show the data
In short, the page change its content by using javascript (which is what it can do best, change things on the client side), but the content is taken from another file, as a result of a request to that file (.php file or any).
In the example page in response #2, the 'processor' outputs data in XML format, while in Rasmus' tutorial it outputs plain text with | as delimiter. string before the | is used as a marker for what div (or any) ID should change its content.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |