473,385 Members | 1,326 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,385 software developers and data experts.

Fetching a page in the background

I'm sure there's some fancy Ajax way to do this, but I'm looking for
something simple. Is it possible to fetch a page from within a javascript
function? Basically what I want to do is allow the user to click a button to
add an item to a shopping cart *without* leaving the current page. Something
like this:

<a href="javascript:addToCart()">Click to add this thing to the cart</a>

<script>
function addToCart() {
String results =
fetchPage("http://mysite.com/addToCartPage.jsp?item-number=123");
alert(results); // shows a success or failure message
}
</script>

Unfortunately, I can't find any such fetchPage() function. Is there a
simple, cross-browser way to do the same thing?
Feb 7 '06 #1
1 1206
"Chris" <anon> wrote:
I'm sure there's some fancy Ajax way to do this, but I'm looking for
something simple. Is it possible to fetch a page from within a javascript
function?


http://jibbering.com/2002/4/httprequest.html
--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Feb 7 '06 #2

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

Similar topics

0
by: Andres Baravalle | last post by:
Hi, I have a problem using a URL fetching algorithm (HTTP 1.0). To download an image, I used to use this algorithm: <?php Header("Content-type: image/gif"); $referer =...
4
by: Els | last post by:
Hi, I would like an opinion on the following: I have a page which is made up of background-images with transparent linked images in front of it, which on hover show text in CSS popups. Due to...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
1
by: MD | last post by:
When displaying the metadata for our system, takes about 5 seconds to display 10 results to the browser. The whole process works like this. 1. Call the servlet from the javascript with Dom var...
22
by: Sandman | last post by:
So, I have this content management system I've developed myself. The system has a solid community part where members can register and then participate in forums, write weblogs and a ton of other...
0
by: satishr23 | last post by:
Hi, I am trying to parse the contents of a PHP page from the web which requires me to authenticate. I guess the way to do this is to make my program login to the login page,grab the cookie and...
10
by: anonymous | last post by:
How can I set report output parameter "Page 1 of max" to get output on first page in minimum time as it takes much time in fetching max page no. in first page and report is of around million pages
1
by: soluvah | last post by:
Hello Folks, Been trying to widen my site's body from "779" to "1000" so it almost fills the window. IE 7 on windows XP just dismantles the pages and leaves wide gaps between the left column and...
2
by: SunshineInTheRain | last post by:
I'm trying to modify a long long code within a button click by make the insert/update/delete/select using the same transaction. Purpose is to make sure every operation can be rollback instead of some...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.