I am trying to match a passed parameter on a url to an area on an image map. So far I can find the correct area using Code: $('#mediummap area').each(function(i){ href = $(this).attr('href'); if (href == id) { alert('Found ID ' + id); }});}});
But next I need to retrieve the co-ordinates for the Area. I have tried Code: coords = $('this').attr('coords'); And Code: coords = $('this').coords();
I can not seem to get the value back, just an undefined return. What I want to do is to find the point on the image map and then centre that point with in the viewport for the image (large image, small viewport).
I have a javascript function that is called in an OnClick event for a button. I am attempting to get the function to open a web page in a new window in response to a button click.
I can get the page to open if I use the following syntax (hard code the address)
var newwin = indow.open("http://www.w3schools.com","","width=1200height=1000");
However, If I pass the url in as a parameter to the function (as below) the value passed in is "Undefined" and obviously the page will not open
function openThePage(url) { url = "http://www." + url; var newwin = window.open(url,"","width=1200height=1000"); }
<input class="mybutton" type="button" name = "W3Schools" value="w3schools.com" onclick="openMyUrl(W3Schools.Value)">
Anyone any idea how I can do what I want - what I am doing wrong. I am grey enough as it is and I don't want to start pulling my hair out.
I'am building a little site with jquery. Now I have a Problem. I want that if in the url ?product=anyid is, a function is called. If the url is empty and has no parameter the normal site should appear and run.This is for building a permalink to products and you can open them with [URL].
I am in doubt if im doing this correct. I have a TD which I have a onclick and a google event tracking code on. But om not shure if I have set it up correct. The () and the , might be wrong..?
I am trying to pass the appropriate parameters but nothing seems to be working?
function calcSubTotal(unitPriceId, qtyId, subTotalFieldId) { var unitPrice = parseFloat(document.getElementById(unitPriceId).value); var qty = parseInt(document.getElementById(qtyId).value); <tr> <td><table><tbody>
I have a checkbox in a form that submits to another page along with a couple of other fields in the form. Problem is I need the info to be received as url parameters on the second page. All is good except for the checkbox. The checkbox only creates a url parameter if it's checked, otherwise there's no url parameter for it. Is this typical?
I'm trying to use it again with bit of modification but I'm not quite sure if this is possible. I'm working on JSP pages I've passed a textfield ID parameters and received it on other page(jsp) like so;
Code:
<%= request.getParameter("id") %>
I'm gonna use this ID as a StartTime. How can I use this with StartTime that is in this JavaScript function so that StartTime would be what the ID is and EndTime can be choosen by dropdown box?
I use URL parameters to track the source of a click and track Pay-Per-Click results. For example, if a click originates from Google AdWords, the URL is www.mysite.com/?source=google. For Google this works fine, but for many other Pay-Per-Click search engines, the URL parameter seems to get lost and the user gets directed to www.msysite.com.
Let's call the search engine for which this does not work "dummy". I was thinking about sending users directly to www.mysite.com/dummy.html, and within dummy.html I would set the parameter within a JavaScript to what "dummy", using this command: var source = "dummy".
This does not seem to work, the php program that is executed later within the JavaScript does not correctly interpreted the source variable and therefore does not register a click from search engine "dummy". So, the question is, how can I set the source variable within the HTML if it has not been passed as part of the URL.
I have a simple JS function that I want to return a true or false value based on the parameter passed in. At this point of time I receive the error "'True' is undefined". Here is my code below.
onclick="ShowSpecifiedPeriod(<%If bShowPeriod = false then Response.Write true else Response.Write false%>)"
The ASP variable bShowPeriod is set based on the hidden form field "ShowPeriod" and the initial value is set to false.
More than likely this has to do with the boolean Parameter but I am not sure how to handle this in JS. I have tried the following but receive the same results.
function ShowSpecifiedPeriod(boolean pShowPeriod) - Same Error function ShowSpecifiedPeriod(pShowPeriod boolean) - Same Error
The following information is passed to a script to generate an email from a form. <INPUT TYPE="hidden" name="param_recipient" value="me@mycompany.org">
In the form further down on the page, a user enters a value in the ru field. I want to write something similar to: if ru=122 then sendformto="me@mycompany.org" if ru=144 then sendformto="you@mycompany.org"
the paramater above would then become something like: <INPUT TYPE="hidden" name="param_recipient" value=sendformto>
In that function, i call a function (load_CDThumbnail) that creates an array and returns the newly created array
Then, another function is called (show) that needs to pass the newly created array as a parameter. That's the part that i don't know how to program How to pass an array as a parameter? Code:
I am writing a validation function: what I want to do when an error is detected is to open a second window containing error messages. The form being validated is rather long, and there are several points in the code where I write the messages. So, I would like to have a separate function just to open the second window with an appropriate title (something like "the following errors were detected in your form"). something labout like this:
Looks like attr("name","value") method is not working to set name attribute value for input type in IE 7. It works fine in IE 8 and other browsers. Method works fine for other attribute in IE 7 e.g. id attribute
While setting name attribute it sets 'submitName' attribute and not 'name' attribute. Somehow IE 7 is not allowing to set name attribute dynamically.[code]...
But this issue is showstopper for us and I thought to check with forum if anyone has any suggestion for workaround.
Firebug's console is showing when visiting my test.html page Headers, Post and Response. In the Post tab it is showing: "id 9". I need to create a new page and get that 9 in it so I can use it. I don't mind jQuery, Ajax or Javascript but I need that 9. I know that with php I just need $_REQUEST["id"]; but I cannot use php.
I have an XML string which I want to pass to a java script function, where I am displaying that in different window with use of 'window.open()' method, but it is giving error.