|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome. |
Share Thread: & Tags
|
||||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hey, I have a "how to" question.
On my site, visitors are able to view a larger-sized image (a popup) of a product by clicking on the image. Clicking on the "add to cart" button allows them to add the item to their cart from the popup. I currently have it programmed to redirect to the cart page (of which I don't mind changing). It doesn't look good when the cart page appears in the same 300x400 child page. I'd like to have the popup add the item to the cart, close the page, and issue a "refresh" of the parent page -- so the cart $$$ can be updated. Most of the site is PHP driven. Any ideas? John |
|
|||
|
Hi, Uncle Dog...
Great tip! Thanks... I've implemented the changes but nothing happens when I click on the "Add to cart" button. I set Add To Cart as an anchor: <a onClick="javascript:window.opener.fnAddToCart('BDG C11C',1);" href="javascript:void(1)"> <img alt="Add to your personal shopping cart image" src="../img/add-to-cart.gif" width="60" height="20" /> </a> Something wrong? John |
|
||||
|
getmea - something wrong? Yes. It should be
<a href="javascript:window.opener.fnAddToCart('BDG C11C',1);"> EDIT: apologies. on closer inspection - your way was OK. I knee-jerked to a personal preference. Last edited by Uncle Dog; 08-23-2009 at 10:31 PM. |
|
||||
|
getmea - in your new function you are trying to close productpreviewwindow (it doesn't exist). It should be productPreviewWindow. That's where your code is hanging.
EDIT - hope you don't mind me revisiting your dev' site. I guessed that's where you'd be testing. Last edited by Uncle Dog; 08-23-2009 at 10:53 PM. |
|
|||
|
Sorry, U Dog...I was so excited that it worked that I wound up testing (in IE) every single pic and anchor. I've yet to test it in FF.
Yes, I found the discrepancy between productPreviewWindow/productPreviewWin/productpreviewwindow and corrected it. What's next? Now I will implement in every single page which calls out to the Closer Look (sku2.php) page. THANKS VERY MUCH FOR YOUR ASSISTANCE!!!! Regards, John |
|
|||
|
Isn't it like 3:15 in the morning in Scotland???
|
|
|||
|
Quote:
Thanks for the tip. Unfortunately, I am AJAX illiterate. Someday, I'll pick up an Ajax for Dummies book and learn. Regards, John |
|
||||
|
getmea - yes my last post was at 2:51 am. Glad to have been of help.
You're not AJAX illiterate - it's basically a mish mash of web technologies usually revolving around JavaScript on the client ,which you obviously understand. Wikipedia describe it beautifully, warts and all - Ajax (programming) - Wikipedia, the free encyclopedia I think there is a tendency to think of AJAX as a tool when it's actually a toolbox. |
|
||||
|
Whilst AJAX isn't perfect, it's biggest advantage is that you can go back to the server to do stuff and then refresh only part of the page.
Problem with doing a full refresh is the whole page disappears and rebuilds. This is both annoying for users and time consuming. I would always recommend using AJAX over refreshing a full screen. Just take the W3Schools AJAX primer and away you go. Nothing complicated to it at all. It shouldn't take you more than 15 minutes to do the tutorial and get your first AJAX thingy working. Last edited by DaveSawers; 08-24-2009 at 02:13 PM. |
|
|||
|
Good tip, Dave...I'll check out the Ajax Primer...
Thanks. |
|
|||
|
__________________
PHP HTML SQL tutorials and articles. Free scripts:Web Hosting Directory:Funny Star Jokes: |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Page refresh and screenreader users issue | Webnauts | Accessibility and Usability Forum | 2 | 05-03-2006 01:48 PM |
| preloading child movies into parent movie | pbrollwitme | Flash Discussion Forum | 1 | 07-18-2005 03:16 AM |
| Refresh page automatically on arrival | Milo | Web Programming Discussion Forum | 1 | 01-28-2005 07:33 PM |
| How do I force the page to refresh from the server? | zwickes | Web Programming Discussion Forum | 2 | 11-21-2004 01:34 PM |
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |