How to enter JavaScript code into Wordpess Page?

Discussion in 'JavaScript' started by galapagos, Feb 9, 2011.

  1. #1
    Guys, my CMS is Wordpess.. I need to enter the following java script code onto page:

    <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 = "my id";
    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=my ID&res=2"><img src="https://www.shmktpl.com/images/nojs/image.asp?src=my ID&res=2" border="0"></a></noscript>
    Code (markup):

    how to do this? I'm not so good with programming, how can I get this java script code onto Wordpess page?
     
    galapagos, Feb 9, 2011 IP
  2. mallorcahp

    mallorcahp Peon

    Messages:
    141
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Search & install a JavaScript Plugin that allows you to add javascript to a post / page in the Plugins Admin area of you blog.

    Normally you will then have to place the code in the post / page (in HTML view) between some sort of tags ... e.g. [jscript] [/jscript] or simlar.
     
    mallorcahp, Feb 10, 2011 IP
  3. galapagos

    galapagos Well-Known Member

    Messages:
    217
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    105
    #3
    Appreciate it.. I'll try that
     
    galapagos, Feb 10, 2011 IP
  4. east2westcoast

    east2westcoast Greenhorn

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #4
    did that work for you?
     
    east2westcoast, Mar 15, 2011 IP
  5. galapagos

    galapagos Well-Known Member

    Messages:
    217
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    105
    #5

    no, it didn't.. basically what I did was to upload the .html page into my server through ftp manually with java script in it...
     
    galapagos, Mar 15, 2011 IP
  6. dollarearner

    dollarearner Active Member

    Messages:
    233
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #6
    should the domain be approved by surehits for this code to function?
     
    dollarearner, Apr 17, 2011 IP
  7. Tanya Roberts

    Tanya Roberts Active Member

    Messages:
    250
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    75
    #7
    try the HTML view on the editor.. by default it is set to wysiwyg...
     
    Tanya Roberts, Apr 17, 2011 IP
  8. robi09

    robi09 Member

    Messages:
    298
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #8
    Edit header.php or single.php or index.php . Need to work. ;)
     
    robi09, Apr 20, 2011 IP
  9. cyborg90

    cyborg90 Peon

    Messages:
    81
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Where do you want to insert the code? In the top of all posts, header,etc
     
    cyborg90, Apr 20, 2011 IP