Jump to content

Recommended Posts

 

Here's my $_SESSION start:

 

<?php session_start();
$section = $_SESSION["nav"];
?>

 

 

My js:

 

<script language="JavaScript" type="text/javascript">

$(document).ready(function() {

          $("div.tabs").tabs(".images > div", {

                // enable "cross-fading" effect
                effect: 'fade',
                fadeInSpeed: 600,
                fadeOutSpeed: 1000,

                // start from the beginning after the last tab
                rotate: false

          // use the slideshow plugin. It accepts its own configuration
          }).slideshow({autoplay: false, interval:5000});
          
          
          $("a.lnav").onclick(function() {
			    // Get the ID of the link
			    var src = $(this).attr("id");
				alert(id);

			    // Send Ajax request to backend.php, with src set as "id in the POST data
			    $.post("/backend.php", {"id": src});
			});
          
          });
</script>	

 

 

Here's backend.php:

 

<?php
    // do any authentication first, then add POST variable to session
    $_SESSION['nav'] = $_POST['id'];
?>

 

 

Why can't I get the alert(src) to work?

Link to comment
https://forums.phpfreaks.com/topic/206720-why-isnt-this-alert-working/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.