Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 50

Thread: javascript help

  1. #21
    Administrator Alan92RTTT's Avatar
    Join Date
    Jul 2010
    Owner Since
    02/1998

    Location
    Madison Heights, Mi
    Posts
    2,958
    Blog Entries
    7
    Thanks
    16
    Thanked 675 Times in 255 Posts
    you still have AIM?

    FYI, you pulled some of the stuff I did with color. I did that so it would pick up the color for what ever page it on. I did not want the tab/links hard coded for color.

  2. #22
    Administrator Alan92RTTT's Avatar
    Join Date
    Jul 2010
    Owner Since
    02/1998

    Location
    Madison Heights, Mi
    Posts
    2,958
    Blog Entries
    7
    Thanks
    16
    Thanked 675 Times in 255 Posts
    I think I see the problem. The appendTo's are not done rendering when the last block of JS is run and its errors. I need a way to make it wait for them.

  3. #23
    Administrator Alan92RTTT's Avatar
    Join Date
    Jul 2010
    Owner Since
    02/1998

    Location
    Madison Heights, Mi
    Posts
    2,958
    Blog Entries
    7
    Thanks
    16
    Thanked 675 Times in 255 Posts
    I think I have it.


    Now the next step. I need to be able to include it in an html page with a script tag. fun...

  4. #24
    3SWiki.org
    Join Date
    Sep 2010
    Owner Since
    10+ Years

    Location
    The Silver State
    Posts
    661
    Thanks
    73
    Thanked 94 Times in 53 Posts
    I do still have AIM, Shaun I Am.

    I'll keep troubleshooting with you. I think you're in the home stretch now though.

  5. #25
    Administrator Alan92RTTT's Avatar
    Join Date
    Jul 2010
    Owner Since
    02/1998

    Location
    Madison Heights, Mi
    Posts
    2,958
    Blog Entries
    7
    Thanks
    16
    Thanked 675 Times in 255 Posts
    I'm having an issue with the json call.

    I've moved the html to http://mi3si.org/beta/3sg_footer-2.htm because I am trying to test loading the json from a separate server using jsonp.

    You can see the json here http://3sg.org/beta/include_js.php

    The JS is coming from 3sg.org and running with no issue until it throws a "missing variable name" error when processing the json results.

    json call code.
    PHP Code:
        var data = $.ajax({
            
    url 'http://www.3sg.org/beta/include_js.php',
            
    dataType "jsonp",
            
    jsonp'callback',
            
    jsonpCallback'getData',
            
    timeout 10000,
            
    success: function(){
                
    alert("success");
            }
        });
        function 
    getData(data){
            $(
    '#tabHeader').text(data.message);
        } 

  6. #26
    3SWiki.org
    Join Date
    Sep 2010
    Owner Since
    10+ Years

    Location
    The Silver State
    Posts
    661
    Thanks
    73
    Thanked 94 Times in 53 Posts
    Hmm, if you want to use jsonp, here's how I did it:

    3SG.org Tabs Demo (Remote Server)

    My copy of the json file that the Portland3S domain is accessing can be found at:
    http://www.stealthify.com/3sgto/proj...absXserver.php

    Does it work for you?

  7. #27
    Administrator Alan92RTTT's Avatar
    Join Date
    Jul 2010
    Owner Since
    02/1998

    Location
    Madison Heights, Mi
    Posts
    2,958
    Blog Entries
    7
    Thanks
    16
    Thanked 675 Times in 255 Posts
    oh this is frustrating. My code with your include works. With mine(which seems to return the same thing) does not work.


    ARG.

    PHP Code:
    <?php
        $data 
    = array(
            
    "groups"=> array(
                 array(
                    
    "name" => "Events",
                    
    "title" => "3000GT/Stealth/GTO Event Pages",
                    
    "links" => array(
                        array(
    "name"=>"3S National Gathering","url"=>"http://www.3sng.org"),
                        array(
    "name"=>"East Coast Gathering","url"=>"http://www.3secg.com"),
                        array(
    "name"=>"Upper Mid-West Gathering","url"=>"http://umg.mn3s.org"),
                        array(
    "name"=>"Blue Ridge Gathering","url"=>"www.blueridgegathering.com"),
                    ),
                ),
                 array(
                    
    "name" => "Groups",
                    
    "title" => "3000GT/Stealth/GTO Clubs and Groups",
                    
    "links" => array(
                        array(
    "name"=>"Michigan 3S","url"=>"http://www.mi3si.org"),
                        array(
    "name"=>"MInnesota 3S","url"=>"http://www.mn3s.org"),
                        array(
    "name"=>"Wisconsin 3S","url"=>"http://www.w3si.org"),
                        array(
    "name"=>"3000GT/Stealth/GTO Forums","url"=>"www.3sgto.org"),
                        array(
    "name"=>"Texas 3S","url"=>"www.texas3s.com"),
                        array(
    "name"=>"3000GT/Stealth International","url"=>"www.3sl.org"),
                    ),
                ),
                 array(
                    
    "name" => "Information",
                    
    "title" => "3000GT/Stealth/GTO Information and Resources",
                    
    "links" => array(
                        array(
    "name"=>"Stealth 316","url"=>"http://www.3sng.org"),
                        array(
    "name"=>"3000GT / Stealth / GTO Information","url"=>"www.3sg.org"),
                    ),
                ),
            ),
        );

        
    $json_data json_encode($data);

        echo 
    '<pre>('$json_data.');</pre>';

  8. #28
    3SWiki.org
    Join Date
    Sep 2010
    Owner Since
    10+ Years

    Location
    The Silver State
    Posts
    661
    Thanks
    73
    Thanked 94 Times in 53 Posts
    Remove the pre tags, and designate a callback function (or use the automatically generated one):

    PHP Code:
    <?php
    // Build Links Array
    $data = array(
            
    "groups"=> array(
                 array(
                    
    "name" => "Events",
                    
    "title" => "3000GT/Stealth/GTO Event Pages",
                    
    "links" => array(
                        array(
    "name"=>"3S National Gathering","url"=>"http://www.3sng.org"),
                        array(
    "name"=>"East Coast Gathering","url"=>"http://www.3secg.com"),
                        array(
    "name"=>"Upper Mid-West Gathering","url"=>"http://umg.mn3s.org"),
                        array(
    "name"=>"Blue Ridge Gathering","url"=>"http://www.blueridgegathering.com"),
                    ),
                ),
                 array(
                    
    "name" => "Groups",
                    
    "title" => "3000GT/Stealth/GTO Clubs and Groups",
                    
    "links" => array(
                        array(
    "name"=>"Michigan 3S","url"=>"http://www.mi3si.org"),
                        array(
    "name"=>"MInnesota 3S","url"=>"http://www.mn3s.org"),
                        array(
    "name"=>"Wisconsin 3S","url"=>"http://www.w3si.org"),
                        array(
    "name"=>"3000GT/Stealth/GTO Forums","url"=>"http://www.3sgto.org"),
                        array(
    "name"=>"Texas 3S","url"=>"http://www.texas3s.com"),
                        array(
    "name"=>"3000GT/Stealth International","url"=>"http://www.3si.org"),
                    ),
                ),
                 array(
                    
    "name" => "Information",
                    
    "title" => "3000GT/Stealth/GTO Information and Resources",
                    
    "links" => array(
                        array(
    "name"=>"Stealth 316","url"=>"http://www.3sng.org"),
                        array(
    "name"=>"3000GT / Stealth / GTO Information","url"=>"http://www.3sg.org"),
                    ),
                ),
            ),
    );

    // Encode Links Array to JSON
    $json_data json_encode($data);

    // Collect & Sanitize Random callback parameter
    $callback preg_replace("/[^a-zA-Z0-9\.\_\[\]]+/"""$_GET['callback']);

    // Output Results
    echo $callback.'('.$json_data.');';

  9. #29
    Administrator Alan92RTTT's Avatar
    Join Date
    Jul 2010
    Owner Since
    02/1998

    Location
    Madison Heights, Mi
    Posts
    2,958
    Blog Entries
    7
    Thanks
    16
    Thanked 675 Times in 255 Posts
    ah you have some extra stuff in your include


    I had a feeling that was the case. I added the pre's because they came out if I pulled your file up in a browser


    AWESOME

    http://mi3si.org/beta/3sg_footer-2.htm

  10. #30
    3SWiki.org
    Join Date
    Sep 2010
    Owner Since
    10+ Years

    Location
    The Silver State
    Posts
    661
    Thanks
    73
    Thanked 94 Times in 53 Posts
    Nice! Glad it worked.

    Enjoy.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
The 3000GT/Stealth/GTO Web History Project
3000gt.com
3000GT / Stealth International WWWboard Archive
Jim's (RED3KGT) Reststop
3000GT/Stealth/GTO Information and Resources
Team 3S
3000GT / Stealth / GTO Information
daveblack.net
3000GT/Stealth/GTO Clubs and Groups
Michigan 3S
MInnesota 3S
Wisconsin 3S
Iowa, Nebraska, Kansas 3S
North California 3000GT/Stealth
United Society of 3S Owners
3000GT/Stealth/GTO Forums
3000GT/Stealth International
3000GT/Stealth/GTO Event Pages
3S National Gathering
East Coast Gathering
Upper Mid-West Gathering
Blue Ridge Gathering