Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2009
    Posts
    159
    Tokens
    0

    Default Dynamic Ajax Content

    I'm using Dynamic Ajax Content off Dynamic Drive I have it all working fine, I'm more than capable of that. But say I wanted to add a throne generator to my site.. When they click "Generate" it takes you to the page the throne generator is on and doesn't load it into the actual content box, because to load it into the content box it needs an ajax link and with an <input type="submit"> button - you can't put links in can you? So is there a way of doing this?

    Jake told me to ask Iszak but he isn't on MSN atm, anyone else know how I can do this? Thanks

  2. #2
    Join Date
    Nov 2008
    Posts
    217
    Tokens
    1,822
    Habbo
    eLv

    Latest Awards:

    Default

    What I do is to put it in an iframe, and have it loaded into the divs.






  3. #3
    Join Date
    Jan 2009
    Posts
    159
    Tokens
    0

    Default

    Yeah I was gunna do that, but I wanted it all Ajax - Jake told me Iszak helped him do it once, so it is possible so does anyone know how?

  4. #4
    Join Date
    Oct 2007
    Location
    Luton, England
    Posts
    1,548
    Tokens
    388
    Habbo
    DeejayMachoo

    Latest Awards:


  5. #5
    Join Date
    Jan 2009
    Posts
    159
    Tokens
    0

    Default

    Quote Originally Posted by DeejayMachoo View Post
    Thanks, but sorry to be a pain but I've looked through it and I'm not sure where I would add the codes say in the "Kissing Generator" script it says use a function like $.post but where abouts would I add it in a code like this?

    Code:
                <?php
                    if($_POST['submit'])
                    {
                        if($_POST['habbo1'] && $_POST['habbo2'])
                        {
                            echo "<img src=\"generate.php?habbo1=" . urlencode($_POST['habbo1']) . "&habbo2=" . urlencode($_POST['habbo2']) . "\" alt=\"Generated Image\" />";
                            echo "<br /><br />";
                        }
                        else
                        {
                            echo "<div style=\"background: #dd0000; color: #fff; margin: 5px; padding: 5px;\">All fields are required!</div>";
                        }
                    }
                    else { echo "<br />"; }
                ?>
    
                <form action="" method="post">
                    Habbo One:<br /><input type="text" name="habbo1" maxlength="32" />
                    <br /><br />
                    Habbo Two:<br /><input type="text" name="habbo2" maxlength="32" />
                    <br /><br />
                    <input type="submit" name="submit" value="Generate" />
                </form>
    Sorry, I'm not very good with Ajax.

  6. #6
    Join Date
    Dec 2006
    Location
    Swindon
    Posts
    3,299
    Tokens
    215
    Habbo
    dunko

    Latest Awards:

    Default

    Just have a blank div then update the div to contain the page throne.php?name=something or something like that (change your throne thing to GET and use onsubmit to do that using jquery)

  7. #7
    Join Date
    Jan 2009
    Posts
    159
    Tokens
    0

    Default

    Quote Originally Posted by Blob View Post
    Just have a blank div then update the div to contain the page throne.php?name=something or something like that (change your throne thing to GET and use onsubmit to do that using jquery)
    I did GET and onclick="$.post("throne.php");"

    but it didn't work, can you show me an example please xoxo

  8. #8
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    First off, Dynamic Drive is terrible, avoid anything thay make at any costs its bloat and more than that its bload that bearly works.
    I posted a script that will do the ajax loading in the tutorials here a while back, its only a few lines but is much more robust and less error prone than the DD equivlent.

    If doing the js all yourself desont have any real signifcance though DeejayMachoo has the right idea, JQuery is quick, easy and efficent, well worth the few minutes it takes to get your head round it

    Mentor

  9. #9
    Join Date
    Dec 2006
    Location
    Swindon
    Posts
    3,299
    Tokens
    215
    Habbo
    dunko

    Latest Awards:

    Default

    Quote Originally Posted by Mentor View Post
    First off, Dynamic Drive is terrible, avoid anything thay make at any costs its bloat and more than that its bload that bearly works.
    I posted a script that will do the ajax loading in the tutorials here a while back, its only a few lines but is much more robust and less error prone than the DD equivlent.

    If doing the js all yourself desont have any real signifcance though DeejayMachoo has the right idea, JQuery is quick, easy and efficent, well worth the few minutes it takes to get your head round it

    Mentor
    OMG since when have you started posting again

    Edited by Xarea (Forum Moderator): Please do not post off topic.
    Last edited by Xarea; 05-05-2009 at 07:26 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •