Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > BOOK: Professional CodeIgniter ISBN: 978-0-470-28245-8
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional CodeIgniter ISBN: 978-0-470-28245-8
This is the forum to discuss the Wrox book Professional CodeIgniter by Thomas Myer; ISBN: 9780470282458
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional CodeIgniter ISBN: 978-0-470-28245-8 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #11 (permalink)  
Old November 4th, 2009, 09:10 AM
Wrox Author
 
Join Date: May 2008
Location: Austin, TX, USA.
Posts: 53
Thanks: 0
Thanked 5 Times in 5 Posts
Default so......

somewhere in your main template view, you need to have something like this:

Code:
<script type="text/javascript">
//<![CDATA[
base_url = '<?= base_url();?>';
//]]>
</script>
that way you can use base_url in your javascript as needed.

just need to check, is that what you have?
__________________
Thomas Myer
Author, Professional CodeIgniter
http://www.tripledogs.com
Reply With Quote
  #12 (permalink)  
Old November 4th, 2009, 04:02 PM
Authorized User
 
Join Date: Nov 2009
Posts: 26
Thanks: 3
Thanked 0 Times in 0 Posts
Default Yes, I have it but...

Yes, I have it but it seems it does nothing.
Reply With Quote
  #13 (permalink)  
Old January 12th, 2011, 12:03 PM
Registered User
 
Join Date: Jan 2011
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What works for me:

function jsUpdateCart()
..
url: "<?php echo site_url() . 'shop/ajax_cart';?>",
..

EDIT: i put the JS code in the template.php ..

EDIT2 : i use JQuery but with scriptaculous may seem like this, if you put the script in template.php file:

var ajax = new Ajax.Updater(
'ajax_msg', <?php echo site_url() . 'welcome/ajax_cart';?>, {method:'post',parameters:params,onComplete:showMe ssage}
);

trust me, 100% working this way

Last edited by Linc0ln; January 12th, 2011 at 12:13 PM.
Reply With Quote
  #14 (permalink)  
Old November 23rd, 2011, 11:39 AM
Registered User
Points: 46, Level: 1
Points: 46, Level: 1 Points: 46, Level: 1 Points: 46, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2011
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default hi , can you tell us what apatche you used please ?

Quote:
Originally Posted by myerman View Post
the base_url addition is a weird one. on my dev, test, and production servers, I don't need it at all. however, this easy fix has worked for various folks I've been emailing with. I'm not really sure what's happening here, maybe it has something to do with the way the different apache installs produce paths....?
hi,
i have apatch 2.0.49 and the javascript code didnt worked till i added the base_url string , can you tell us what was your apatche version when you developed this project so we can test it without the base_url here,
thank you.
Reply With Quote
  #15 (permalink)  
Old June 4th, 2012, 07:47 AM
Registered User
Points: 11, Level: 1
Points: 11, Level: 1 Points: 11, Level: 1 Points: 11, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Cart Updated message flash and disappears

everything in it running ok javascript pases message to the shopping cart.php and message of update and deletation appears but page again gets refresh and <div id="ajax_msg"> this time appears to be blank any suggestion for stopping the update message to disappear.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Shopping Cart seannie ASP.NET 2.0 Basics 0 December 12th, 2006 09:28 AM
Shopping Cart quantity update problem j2 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 August 21st, 2006 02:39 PM
Shopping Cart inkrajesh ASP.NET 1.0 and 1.1 Basics 2 February 28th, 2006 02:08 AM
shopping cart isheikh BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 2 October 8th, 2004 04:20 PM



All times are GMT -4. The time now is 02:10 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.