1

I have this bit of code

<input type="image" src="/wp-content/themes/happy/images/add-to-cart.png" name="Buy" class="wpsc_buy_button" id="product_<?php echo wpsc_the_product_id(); ?>_submit_button" onclick="alert('Cart Updated');"/>

How do I get that code to redirect to "example.com" instead of displaying the "alert thing?

3 Answers 3

1
  window.location="http://www.example.com";
Sign up to request clarification or add additional context in comments.

Comments

0
<input type="image" src="/wp-content/themes/happy/images/add-to-cart.png" name="Buy" class="wpsc_buy_button" id="product_<?php echo wpsc_the_product_id(); ?>_submit_button" onclick="window.location='http://example.com';"/>

Note the single quotes around the url.

Comments

0
document.location.href = 'http://www.example.com';

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.