CodeIgniter Forums
Javascript - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Javascript (/showthread.php?tid=48893)



Javascript - El Forum - 02-01-2012

[eluser]the_unforgiven[/eluser]
I have some javascript

Code:
echo '[removed]
      alert("Meeting successfully added. Click OK to continue.");
      location = "../admin/clientlist/"; //How do i get the uri in this line
  [removed]';

And I need it to redirect back to the page that has the id on like this:

http://localhost/kproject/admin/updateclient/2


Javascript - El Forum - 02-01-2012

[eluser]meigwilym[/eluser]
Try

Code:
echo '[removed]
      alert("Meeting successfully added. Click OK to continue.");
      location = "'.site_url('admin/clientlist').'";
      [removed]';

Mei


Javascript - El Forum - 02-01-2012

[eluser]the_unforgiven[/eluser]
then how would i get the id like in the url shown


Javascript - El Forum - 02-01-2012

[eluser]Jason Stanley[/eluser]
Like this?

Code:
echo '[removed]
      alert("Meeting successfully added. Click OK to continue.");
      location = "'.site_url('admin/clientlist/'.$id).'";
      [removed]';

Where are you getting the id from?


Javascript - El Forum - 02-01-2012

[eluser]the_unforgiven[/eluser]
Cheers I'll give that a whirl


Javascript - El Forum - 02-01-2012

[eluser]InsiteFX[/eluser]
To display script tags just change the s to $
Code:
// change the $cript to script - $ to s
echo '<$cript>
      alert("Meeting successfully added. Click OK to continue.");
      location = "'.site_url('admin/clientlist/'.$id).'";
      </$cript>';