Calling Function Using Href Not Working In IE8?
Mar 7, 2011
I have a page that loads various "applications" into an iframe inside the main page. One of the applications loaded calls a javascript function that is loaded with the "application" page. It works great in Safari, Chrome & Firefox but error's out in IE8 - "Object doesn't support this action". Have other calls that work but this one is the only one that uses href
[CODE]
<div id = 'trainingsubmitbutton' style='display:none;'><a href='javascript: submitdata(0)'>Submit This Record</a></div>
[CODE]
View 6 Replies
ADVERTISEMENT
Jul 25, 2011
I started with the simplest step - the hide() function:
$(document).ready(function(){
$("a#p").click(function(event){
$("#HiddenDiv").hide();
})
});
It worked fine as long as the href attribute of the anchor tag was '#'. Then I tried using href other than '#' and ran into a problem. I just changed the href to:
<a id="p" href="test.php">Click me</a><br />
<div id="HiddenDiv">Testing mate</div>
test.php is the page in which both these sections (html and jquery) are present, so like a postback to the same page.
This method didn't work and on clicking the anchor tag, the div stayed visible.
I then tried theevent.preventDefault(); method and that worked.
So I experimented more. I tried using the hide function on a dynamic link, something like test.php?a=1.
I ran into a problem again. The div remained visible on clicking that link.
View 17 Replies
View Related
Feb 8, 2009
I have a simple javascript function loadNPlay('file'),
parent.loadNPlay('file');
on clicke event it simply plays the file in a player in the parent window. with IE and Mozilla its working fine but with Safari, when called from iframe this function doesn't work(it does work, ie loadNPlay(..) when called in the same window, in safari)
I have tried:parent.loacation.loadNPlay(..) as well, it doesn't work.
View 2 Replies
View Related
Jul 12, 2010
I'm using the following code (simplified version) to call a Json file, parse it and on each iteration, create a div with an ID of "tab". I'm using this with jQuery UI .tab() to create a listing with entries which have three tabs. Anyhow, the principle seems to work except that when I examine what's happening behind the scenes using Firefox console, I see that each href in the html code produced is causing the Json function to re-fire using the href as it's url target.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
[Code].....
View 6 Replies
View Related
Jan 18, 2006
I am looking for a generic javascript function to identify the form with in which a element exists, thus developer can avoid coding like document.forms[index].submit() - where they are sure, they want the form with in which this element exists is to be submitted. This way when forms are introduced at top level the code can remain unchanged, else every form introduce above in the DOM will result in increasing the index by one.
The code is given below. While doing so i am stuck with 2 problems
P1: In the code, you can see i am giving a explicit 'break' in the code. If i don't do so the code seems to be looping. Obviously i am missing some basic.
P2: I am able to pass 'this' for anchor element by name="xy"
<a href="#" name="xy"
in its onclick function by which, in the javascript function i move up the DOM.
While i am unable to do that on the anchor element given below since this function is now on the href attribute.
<a name="xy1" href="javascript:doFormSubmit(this);">Q test</a>
Hence the script fails. Code:
View 10 Replies
View Related
Apr 28, 2009
The code is working 100%, but the only problem is with the function calling statement. It is working on the first img (picture) i want it to be called on the second picture.
<!DOCTYPE html PUBLIC "-w3cDTD xhtml 1.0 strict EN"
<html xmlns=http:www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns = http:www.w3.org/1999/xhtml">
[code]....
View 1 Replies
View Related
Jul 17, 2011
I have a form button with id="submit". When pressed, ClickGeocode(credentials) is called. This works fine and dandy with: $('submit").click(ClickGeocode) Despite there being no indication that the function takes an argument 'credentials'. So when I want to call the function at some point in my code, I should be able to do something like ClickGeocode(credentials) ... no? However, my issue is that credentials isn't once defined in my code - it is part of Bing Maps function... like so:
function ClickGeocode(credentials)
{
map.getCredentials(MakeGeocodeRequest);
}
So why does it work using .click(), and how can I call the function without user interaction (simply somewhere in my code) even if 'credentials' is not defined?
View 1 Replies
View Related
Jun 18, 2010
I have 2 javascript files: 1 containing generic functions for my site used sitewide and another for a particular web page containing just the javascript for that page. The page is also calling the jQuery javascript file.
What I want to do is have a javascript function in my main javascript file which uses features of jQuery such as show, hide etc. and then I want to call this javascript function from the other page specific javascript file.
[Code]...
This does not work and so was wondering if anyone can point me in the right direction as to how to achieve this or something similar.
View 1 Replies
View Related
Apr 7, 2010
I try to make something where you add elements, and can delete elements later by calling a simple function. I simplyfied it right here: It works only to add the paragraphs, but the delete function doesn't work. Tried already to debug with an alert message after each rule... but the problem is with this rule I guess:
[Code]...
View 2 Replies
View Related
Jan 29, 2010
I'm pretty sure this is a Javascript issue, despite the subject line of this message.I'm using Javascript to create a popup window on my site. Users click on the link and get a popup with supplemental information about the item they clicked on. Works great. The html link to open the popup looks like this:
<a href="javascript:popup(xMoreInfo_popup)" onMouseOut="clearEl();">Click HERE for more information</a>
...where "xMoreInfo_popup" is a variable that tells the "popup" function which information (html code) to display. This then connects to a Javascript function that looks like this:
var popupWin
var wholeWin
function popup(term) // write corresponding content to the popup window
[code]....
Now to my problem. This works as expected and just perfectly in IE. If the user clicks on the GO TO SUPPLEMENTAL link, it autoscrolls down to the supplemental information. In Firefox, however, it behaves quite oddly. Instead, when the link is clicked, the popup window displays the html from the original parent, rather than the information in the popup window! Now I can click on the original "parent window" link in the popup window, then it shows the popup information again in the same popup window, but autoscrolled to the proper place this time.
View 7 Replies
View Related
Feb 11, 2010
Ok I have tried and tried and cannot get this code to work in safari or google chrome.
Basically I am working on a shopping cart. The user will click the paypal pay now button. The form is submitted to paypal via a new window target="_blank"
I also need to refresh the current page. This will write shopping cart data to DB via php upon page refresh.
Safari and google Chrome will open the paypal window, but seems to ignore the javascript to refresh the browser.
FF and IE both work fine.
<script LANGUAGE="JavaScript">
function newPage() {
self.location.href='https://www.artists2you.com/s/orderconfirm.php?ordernumber='.$_SESSION['ordernumber'].'';
[Code]....
View 2 Replies
View Related
May 11, 2010
fixing window.location.href on localpath is not working in Firefox only but working fine in IE.
View 1 Replies
View Related
Dec 17, 2010
I am having a problem changing HREF and Text of a link from javascript.
My code is as colos
Code:
And the javascript code is:
Code:
At first page load, it works fine. But then the link text nor its href don't change.
What could be the error?
View 3 Replies
View Related
Aug 23, 2010
I have an existing website I an trying to modify. In speedscript I have my include libraries and a veriable. Then I need to do an href with a link I have the code as follows <a href="WI_testweb/" + "custno" + ".xls">Matrix</a> The custno is the variable. Is there a way of doing this since the way I an trying is not working?
View 4 Replies
View Related
May 13, 2011
I am creating a little word guess game, with a random function which picks the word from an array of 10 words. The second function checks if the users' letter choice is part of the secret word. Currently, each time the checkGuess() function is called, the word is changed, probably because I am calling the wordPicker() function from within. The wordPicker randomly chooses the word, then returns that word. All I want to do is pull that word into the checkGuess function, without calling the wordPicker function as it currently does. Here is the code:
Create secret word array
var wordList = new Array("stealth", "telephone", "internet", "nickel", "marine", "instantiate", "method", "function", "television", "monitor")
[Code]....
View 12 Replies
View Related
Jun 7, 2010
I am trying to write a function that is being invoked when some one clicks the submit button on the form.<form name="sectionA" action="optionpage.cfm" onSubmit="return abc()">I have three tables with initials textboxes. I want to check if they are empty and return false(stay on the same page), else go to action page.Here is what I am doing, I Created three functions tableA(), tableB(),tableC() call them from function abc(). These functions tableA(), tableB(), tableC() return false if one of the field is empty and stop furthur processing and remain in the same page. If none(errors), then go the other page.i.e if table B has empty fields, page should stop furthur processing and remain in the same page.Here is how I am doing it Can somebody please point out what I am doing wrong here.Even when there is empty field, the code moves me to the actionPage.
View 2 Replies
View Related
Oct 12, 2010
I have a href tag in my pager. When I click on it the slide changes to the ppropriate pager but the I don't get sent to the link even though allowPagerClickBubble is set to true. This works fine when pagerEvent is 'moveover' (as in the exaple posted here) ie. I get sent to the linked page. But it does not work when pagerEvent is the default 'click.cycle'.
View 11 Replies
View Related
May 8, 2009
i have a normal form validation script and on submit button i have called the script onclick= "javascript :return validate();"as long as the fields are empty i get the proper alerts , but i am not able to click on submit even if i click nothing happens.if i remove onclick="javascript:return validate();" i am able to click it
View 1 Replies
View Related
Jul 23, 2005
I have a button that change a number of images src's when I click a
button. The src's are stored in an array and I just use
document[imgName1].src=pics[0] to change the src of the image.
However I want the button to change the link as well to the image that
is displayed but i cannot get it to work. How do I do this. Could
someone tell me or point me in the direction of some code that will do
this.
I would like to do it in a similar way to the pictures. i.e. have all
the links stored in an array and change them when the button is
pressed.
View 2 Replies
View Related
Apr 1, 2010
I'm trying to trigger a function when the user clicks on an image. The function will test for whether a variable passed to it is empty or not and branch accordingly. The image has an <a href> behind it that triggers the function OK, but I cant seem to pass a variable to the function. The variable contains a value from a database field, and I think it is probably a syntax thing because if I set the variable to contain a string instead (i.e. b = 'this works') within the <a href> it works OK. So the problem may be with setting the variable to contain the database field value within the <a href> here's the code:
[ICODE]
"<center><a href=""javascript:void(null)"" onClick=""goConfirm(b);"" b = ""<%=RS(8)%>;"" title=""Get map (open new window or tab)"" ><IMG src=""images/bt_compass.gif"" border=""0"" /></center></a>"
[Code]....
View 5 Replies
View Related
May 7, 2007
I would like to do multiple functions on one onclick, then go to a new page.
Here is my attempt using one function to do two things. Suggestions please
<SCRIPT language="JavaScript">
function submitform()
{
document.form.submit();
default_b.php?action=add_item&id=<?php echo $row["id"]; ?>&qty=1">
}
</SCRIPT>
</head>
<body>
<form name="form" action="">
<input type='checkbox' name='chk'>
</form>
<A href="#" onClick=" submitform();return false;">Add Item</A>
View 1 Replies
View Related
Jun 20, 2010
I've a problem with this ajax function, the url doesn't actualize. I want to see the hash in url, but with the function it's not possible. Why?The code I use in php is:
Code:
<br><a href="#nosotros" onClick="FAjax('nosotros.php' ,'capaContenedora','','get'); return false"><b>nosotros</b></a>
And the function is:
Code:
function FAjax (url,capa,valores,metodo)
{
var ajax=creaAjax();
var capaContenedora = document.getElementById(capa);
[code]...
View 9 Replies
View Related
Dec 11, 2010
I am using the featured content slider, where i want 2 sliders on the same page. when i call more than one time the first one is working and not the second one.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
[code]....
View 1 Replies
View Related
Aug 18, 2011
I am trying to show the time and when you click it I want it to go away. But its not working.
<script type="text/javascript">
var date=new Date();
var time=date.getHours();
[Code].....
So I dunno what im doing wrong but when I do this the page is blank.
View 4 Replies
View Related
Jan 1, 2011
How can I set a href or onclick function for an "a" element that passes information to the function?I have a function showpage() that is called whenever one of a number of buttons are clicked. I need to pass information from the button clicked to that function.
View 4 Replies
View Related
Jul 21, 2006
I try to do the following:
function Init() {
alert('Anything');
}
pushInit(alert('Anotherthing'));
When i call the second function the first one must expand dynamically.
View 1 Replies
View Related