Create a redirect page with Javascript

danejCode Snippets

When you have a complicated marketing funnel, sometimes you need to “fire a pixel” on certain pages to ensure your tracking picks up the progress of your visitor. This is typically a piece of javascript that needs to run or it may be an image that loads on a 3rd party server. To redirect the page using javascript: window.location.replace(“http://your.domain.com”); You … Read More

Get selected text and value from drop down

danejCode Snippets

I often find myself needing the selected text from a drop down box. Using jQuery, a simple way to get the text is: $(“#dropdownId”).children(“option:selected”).text(); To get the value of the selected item, you can use: $(“#dropdownId”).children(“option:selected”).val();