English 中文(简体)
贾瓦伦古兰问题,使数据改头并张贴到URL
原标题:JavaScript problem making redirect and posting prompt data to URL

我期待着从人口信息中提取数据,并通过员额传递到URL,然后将用户转向新的URL。

If fname and email are there I would like to post fname and email to a URL.

How can I do this?

<script type="text/javascript">
$(document).ready(function() {
  $.msgbox("<p><b>Grocery Coupons Newsletter</b></p><p>Save $$$ With Coupons and Samples in your E-Mail</p>", {
    type    : "prompt",
    inputs  : [
      {type: "text",     label: "Insert your First Name:", value: "", required: true},
      {type: "text", label: "Insert your Email:", required: true}
    ],
    buttons : [
      {type: "submit", value: "OK"},
      {type: "cancel", value: "Exit"}
    ]
  }, function(fname, email) {
    if (fname) {
      
      window.location = "http://www.google.com/";
    }
  });
});

</script>
问题回答

您将需要一种形式(超正文或通过OMM创建一种),将数据附在这一表格和<代码>。

也可以:

  1. Serialize your form parameters into the redirect URL location
  2. Send the users to that URL
  3. Parse that GET information serverside
  4. Redirect the user via the Location: header to the final destination.

通过这样做,你无需在OMM中积极创造新的形式,以便通过。





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签