Passing Parameters to a JQuery Script

I have a task to show/hide two objects on my webform based on two dates.  This is what I have so far:

<%@ Page Language="C#" AutoEventWireup="false" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script>
$(function(){

  var current = new Date();
  var pollstartdate  = new Date("April 1, 2015 13:00")
  var pollenddate = new Date("April 30, 2015 15:00")

  if(current.getTime()>=pollstartdate.getTime() && current.getTime()<=pollenddate.getTime()){
    $('#pollvote').show();
    $('#pollcommentbox').hide();
  }

  else if(current.getTime()>=pollenddate.getTime()){
       $('#pollcommentbox').show();
       $('#pollvote').hide();
   }

});

$('#pollvote').show();
    </script>

<!DOCTYPE html>


 
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
   
    <title></title>
</head>
   
<body>
 <form id="form1" runat="server">
<div id="pollvote" style="display:none">
<p>This is where the user will vote #pollvote</p>
</div>

<div id="pollcommentbox" style="display:none">
<p>This is where the user will leave a comment #pollcommentbox</p>
</div>



</form>
</body>
</html>

Right now I have the two dates that I need hard coded, but I will be getting them off another form.  How do I pass these parameters into my script?
sherbug1015Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
Where it the entry point, that calls the script?  Does that point have access to the parameters from the other form?
0
sherbug1015Author Commented:
Yes
0
Bob LearnedCommented:
Can you show me how you call the script please?  On the surface, I would think that you could just add those parameters to the function call, but somehow I am thinking that it won't be that easy.
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

sherbug1015Author Commented:
I will have to send that to you in the morning.  I am working in another framework called Kentico and I am not sure at the moment how this is going to get called.  

Thanks for getting back.
0
sherbug1015Author Commented:
I answered my own question.  It turns out that a parameter was not necessary.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sherbug1015Author Commented:
In speaking with others using the Kentico framework, there was an alternative to using JQuery.  A macro was placed directly into the webpart that was used instead of Jquery.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
jQuery

From novice to tech pro — start learning today.