1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Problem with javascript in page

Discussion in 'Blogging' started by lossehelin, May 6, 2010.

  1. lossehelin

    lossehelin Junior Member

    Joined:
    May 23, 2009
    Messages:
    195
    Likes Received:
    47
    I am trying to add a javascript code from surehits on the destination page, but nothing is showing... is just wordpress useless with javascript?
     
  2. soft1700

    soft1700 Newbie

    Joined:
    Apr 12, 2010
    Messages:
    8
    Likes Received:
    0
    send me the code i will fix it
     
  3. razohad

    razohad Jr. VIP Jr. VIP Premium Member

    Joined:
    Jan 11, 2008
    Messages:
    701
    Likes Received:
    1,005
    Occupation:
    Software engginer
    Location:
    online most of the time
    wordpress is all for JavaScript
    what is the code you got from surehits and where did you put it on your site?
     
  4. lossehelin

    lossehelin Junior Member

    Joined:
    May 23, 2009
    Messages:
    195
    Likes Received:
    47
    this is the code i got from surehits:
    PHP:
    <script type="text/javascript">
    function 
    getQueryStringVariable(variable) {
    var 
    query window.location.search.substring(1);
    var 
    vars query.split('&');
    for (var 
    i=0;i<vars.length;i++) {
    var 
    pair vars[i].split('=');
    if (
    pair[0] == variable) {
    return 
    pair[1];}}}

    ni_ad_client "111111";
    ni_res_id 2;
    ni_alt_url "https://www.shmktpl.com/search.asp";
    ni_zc getQueryStringVariable('zipcode');
    ni_str_state_code getQueryStringVariable('statecode');
    ni_var1 "";
    ni_display_width 500;
    ni_display_height 1000;
    ni_color_border "";
    ni_color_bg "";
    ni_color_link "";
    ni_color_url "";
    ni_color_text "";
    </script>

    <script type="text/javascript" src="https://www.shmktpl.com/retrieve_listings.asp"></script>

    <noscript><a href="https://www.shmktpl.com/search.asp?src=179482&res=2"><img src="https://www.shmktpl.com/images/nojs/image.asp?src=179482&res=2" border="0"></a></noscript>
    the code is in mydomain/results/ page
     
  5. lossehelin

    lossehelin Junior Member

    Joined:
    May 23, 2009
    Messages:
    195
    Likes Received:
    47
    ok. if i try to insert thecode in a post it works, but not with pages..... :`
     
  6. sceadugenga

    sceadugenga Newbie

    Joined:
    Aug 25, 2010
    Messages:
    1
    Likes Received:
    0
    I've tried adding my Surehits code to posts instead of pages without success. Right now I'm directing users to a static HTML, non-WP results page. Obviously this is pretty inefficient and not so well integrated with the rest of the site.

    Does anyone else have any pointers as to how to integrate the Surehits javascript with Wordpress? I have seen several WP sites doing this well but have been unable to replicate the results. Most of them set their permalinks on the results page to end with .html, like "/results.html" even though it's a WP post.

    I tried the Advanced Permalinks plugin to replicate this; however, my post still ends with a trailing slash: "/results.html/"

    If anyone has any advice, I would truly truly appreciate it. I've been pulling my hair over this :D

    Thanks!
     
  7. king dj

    king dj Newbie

    Joined:
    Sep 23, 2008
    Messages:
    1
    Likes Received:
    0
    will this script works in my site if i dont have a surehits account? if then i will have a look at once ...