Jump to content
php.lv forumi

AJAX Tabs


Morphius

Recommended Posts

Tātad, ir atrasts simple scriptelis AJAX Tabs.

 

Lūk arī tas kods: http://paste.php.lv/f98bf0e9d3459ad00a0753a8f4b86a1c?lang=html4strict

 

un content.php

 

<?php
   if ($_GET['content'] == 1)
   {
   echo 'Content for Page 1';
   }
   if ($_GET['content'] == 2)
   {
   echo 'Content for Page 2';
   }
   if ($_GET['content'] == 3)
   {
   echo 'Content For Page 3';
   }
?>

Nospiežot uz tabiem tiek izvilkts info no content.php faila. Un jautājums ir šāds!

Ielādējoties lapai, netiek ielādēts kāds no tabiem. Respektīvi lai ielādētu kādu tabu, ir jānoklikšķina uz to, bet ir vēlme lai kāds no tabiem(parasti tas ir pirmais) tiktu ielādēts līdz ar lapu.

Kā tas ir izdarāms? Norādīt AJAX kurš tabs ir jāielādē un <body> tegam piemest klāt 'onload'?

Edited by Morphius
Link to comment
Share on other sites

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.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...