JavaScript auto-submit

Discussion in 'Computer Games and General Discussion' started by LittleBigMods, Nov 20, 2011.

  1. LittleBigMods
    OP

    LittleBigMods GBAtemp Regular

    Member
    1
    Dec 28, 2009
    United States
    I'm trying to add a small query to the end of the url: "http://www.easypolls...634b0e4414d107e" to automatically check and submit "Option 5" (value="4").

    I've tried editing the source html, but I know that's only local, and that I would need to upload an edited page to a host for others to see the changes.

    When I do that, however, I lose references to the root of the website, "www.easypolls.net".

    Here's what I came up with after editing the source:
    Code:
        Poll - EasyPolls.net var jQueryTags="%3Cscript type='text/javascript' src='http"+(location.protocol==='https:'?'s':'')+"://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js\'>%3C/script%3E"+"%3Cscript type='text/javascript' src='http"+(location.protocol==='https:'?'s':'')+"://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js\'>%3C/script%3E";document.write(unescape(jQueryTags));  var $opj=window.jQuery;function ZOPP(name){name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(window.location.href);if(results==null)return "";else return results[1];};$(function(){var OPP_BASEURL=window.location.href;var OPP_pollId=ZOPP("p");OPP_BASEURL=OPP_BASEURL.substring(0,OPP_BASEURL.indexOf(".html"))+"?jsoncallback=?";var params={command:"getPoll",pollId:OPP_pollId};$.getJSON(OPP_BASEURL,params,function(data){if(data.resultCode=="0"){if(data.rtlEnabled)$("html").attr("dir","rtl");eval("data.style = "+data.styleString);$(".OPP-poll-content").attr("id","OPP-poll-id-"+data.pollId).data("OPP_BASEURL",OPP_BASEURL).pollOPP('init',{poll:data});}else{$(".OPP-poll-content").html("Poll is not available.");}});});   	   Thanks for VotingVotevote      
    
    You need to edit the html of the original page "http://www.easypolls...634b0e4414d107e" using your web browser to see it.
    Clicking the vote button will vote for "Option 5"

    How can I add a JavaScript query to the address to automatically vote for Option 5 when the original page loads, or edit the page to allow the submit button to work when hosted on a different server?

    Thanks,
    -LBM
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice