Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Using HTML - JQUERY - PHP -> Help

    I have several JS to call several PHP to request SQL table queries and move the data to a list view. I have the index as a list view and SQL for the driver table - This Works! I created another page where the index calls with static HTML listview (4 new pages to choose from) Each will be list the index list view (copied the JS, PHP, and HTML) so I can click the link on page two and go to child page of 2 which is a new list page after a new SQL query is done from a NEW table. The only things is that the INDEX list view has the ID=?? which is past to page two. This driver the SQL as a foreign key to select the next set of records and display on the list view.

    I designed a PPT to show the link of the overall app I am try to write. I will try to attach it.

    Here is some of the code try to get fired up after the main two pages work.
    Code:
    var serviceURL = "http://localhost/demo/";
    
    var swimmers;
    
    $('#swimmerListPage').bind('pageshow', function(event) {
        getswimmerList();
    });
    
    function getswimmerList() {
        $.getJSON(serviceURL + 'getswimmers.php', function(data) {
            /* $("#swimmerList").html("No Results"); */       
            $('#swimmerList li').remove();
            swimmers = data.items;
            $.each(swimmers, function(index, swimmer) {
    /*         html.push("first : ", swimmer.first, ", ",
                       "last : ", swimmer.last, ", ",
                       "birth : ", swimmer.birth, "<br>"); */
                $('#swimmerList').append('<li><a href="swimmerdetails.html?id=' + swimmer.id + '">' +
                '<h4>' + swimmer.first + ' ' + swimmer.last + '</h4>' +
                '<p>' + swimmer.sex + ' | ' + swimmer.birth + '</p></li>');
    /*         {alert("JSON Data-Item : " + swimmer);}     */
            $(swimmer).appendTo("#swimmerList");
            });
            $('#swimmerList').listview('refresh');
        });
    }
    HTML - Below
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    
    </head>
       
    <body>
    
    <div id="swimmerListPage" data-role="page" data-add-back-btn="true" >
    
        <div data-role="header" data-position="fixed">
            <h1>Swimmers</h1>
            <a href="/demo/" class="ui-btn-right" data-icon="home" data-iconpos="notext"
               data-direction="reverse">Home</a>
        </div>
    
        <div data-role="content">
             <ul id="swimmerList" data-role="listview" data-autodividers="true" data-inset="true">
             
             
             </ul>
        </div>       
    
    </div>
    
    
    </body>
    
    </html>
    Attached Files Attached Files
    Last edited by VIPStephan; 06-30-2013 at 10:44 PM. Reason: fixed code BB tags

  • #2
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    Quote Originally Posted by gdisalvo View Post
    I have several JS to call several PHP to request SQL table queries and move the data to a list view. I have the index as a list view and SQL for the driver table - This Works! I created another page where the index calls with static HTML listview (4 new pages to choose from) Each will be list the index list view (copied the JS, PHP, and HTML) so I can click the link on page two and go to child page of 2 which is a new list page after a new SQL query is done from a NEW table. The only things is that the INDEX list view has the ID=?? which is past to page two. This driver the SQL as a foreign key to select the next set of records and display on the list view.
    Please read this to yourself. Now please indicate the problem first and where exactly you are having this problem, in a shorter and simpler way.

    From what i am guessing your link on your list view is not getting the proper id so it's not going to the correct sub page. Is this correct?


  •  

    Posting Permissions

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