Jump to content

maximeGir

New Members
  • Posts

    2
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

maximeGir's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I did that : let me post the code I have ! on the id "word" : on click I fade out the list elements and initiate an ajax http request with a php url that echo more html (just another ul il list elements) here is my javascript. $('#word').click(function(){ var pageToLoad = 'prog'; $('li').fadeOut('slow'); var requestResponse = envoyerRequete(pageToLoad); $('#redirect').replaceWith(requestResponse); }); function envoyerRequete(pageToLoad){ if (pageToLoad == 'prog'){ var url = 'getSelectedPage.php?page='+pageToLoad; url.toString(); var response = ''; $.ajax({ type: 'GET', url: url, async: false, success : function(text){ response = text; } }); } return response; } And here is my php <?php $pageToLoad = null; if(isset($_GET['page'])){ $pageToLoad = $_GET['page']; } if($pageToLoad == 'prog'){ echo "<ul id='newStyle'>"; echo "<br/>"; echo "<li class='linkFromProg' id='contactMe'><a href='mailto:g@gmail.com' >"; echo "contact me</a>"; echo "</li>"; echo "<br/>"; echo "<li class='linkFromProg' id='comment'><a href='http://blog.org'>Leave a comment</a>"; echo "</li>"; echo "<br/>"; echo "<li class='linkFromProg' id='subscribe'><a href='http://blog.org'>Register</a>"; echo "</li>"; echo "</br>"; echo "</ul>"; } ?> And it returns a new html page with the content echoed in the php I just mentionned. It does not replace a div id in the main php generated html i am calling this from. I'm not at validation yet im testing that particular case first. What do you think ? Please let me know man. I really want to understand that concept.
  2. Hi guys and gals, I am setting up an interactive web site for practice (and fun, of course...) that uses some php. Structurally it looks like this : index.php requires another .php file that contain a function that displays the basics elements of the main web page (index) in a DIV. So basically when index.php is loaded, a <div> containing <?php echo functionToDisplayMainContent(); ?> is filled with the returned html markup. which is good. within that returned html there are some href links that make the content fade out and fade in new content (jQuery). So the returned html is to be changed at some point depending on user input (clicking).The new html that appears when user click is generated by another php page that an href links to . My main question is : How do I get php generated html to return in an existing(php generated) html tag,since it returns me a whole new page with the html that is echoed from the php page.I call the php url from an http request written in javascript (jQuery) with .click event handler to the proper #id. I know it's kind of a mess but I could not explain it better. Any help would be appreciated, Cheers. your bad ass canadian friend. Quote MultiQuote Edit
  3. Hi everybody, my name's Maxime I'm from Montreal in Quebec and I just started doing some PHP. I'm comfy with Java , html, css, javascript, starting Python and Ruby(OnRails) soon , felt like phpfreaks was the place to be to learn and ask a few questions here and there. Cheers. Maxime
×
×
  • 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.