Pass "this" In A Fuction Call And Then Use It In The Function?
Jul 8, 2009Supposing I have the following code:
<html>
<head>
<script type="text/javascript">
[code]....
Supposing I have the following code:
<html>
<head>
<script type="text/javascript">
[code]....
I'm trying to build a cascading menu in javascript I got as far as this ; all I want to do is Re-draw the whole page when the link is clicked however I get an object required message the second time the link is clicked (I,m using IE 5) Code:
View 5 Replies View RelatedI want to call java function in javascript.In which we pass one parameter to function and its returns String value which I want to display in alert message.
View 2 Replies View Relatedi want pass a JS function name into a function and call it.
<a onclick="javascript:ajax_loadpage('inittabFeeds()');">babababa</a>
function ajax_loadpage(x_func)
{
// how can i call inittabFeeds() which stored in x_func variable ?
}
I'm trying to pass locally defined function as aparameter. Every time I do it, it causes an error saying something along the lines of "there is no conversion for text to function".
$(document).ready(function(){
jQuery("#confirm-ajax-submit").click(function(event){
var success = function(){
alert("this is what I want to see.");
[Code].....
I cant control the function between the outer and inner fuction. as I use a top.out1() in the children object. I cannot call the function run
within the $(document).ready(function() { function inner1(){alert("alertinner")}}
the question is:
1.How can I call the function inner() directly by the object children svg page?
2.How can I call the function inner() by the function outer1()?
3.How can I call the function outer2() by the function inner()?
<script type="text/javascript">
function outer1(){
alert("outer1alert");
}
[Code]....
On the click of a table row I want to call a function and pass a that particular table row as a table row object to a function. I was wondering how I would do that? And also if I could grab the number of that table row as well.
View 3 Replies View RelatedOne of the problems with IE's attachEvent is that "this" will still refer to the window, as opposed to the object that called the function. Example:
Code:
function alertName() {
alert(this);
[code]....
<button onClick="return popup('<span onClick='selectShape(1, 1, 1)'>test<span>');" tabindex=Ɖ' onFocus="setFocusColor(0,3)">....</button>
This will work perfectly, but as soon as I need to pass Strings inside the selectShape function, I get stuck.
So the question is, how can I create the following and have it working
......selectShape(2, 'Tricky', ཤx5°').....
I'm admittedly a novice when it comes to AJAX. I can get stuff to work, typically, but really have no idea what's going on. I copied the original code from another source.
Now, something a bit more complicated is coming up and I can't get it to work.
Here's the script I'm using to start; the one that I typically use that works fine code...
I'm trying to pass the id of the ul li item clicked to a select*FROM 'id' statement. I keep getting the following errors in the responce.
Quote:
Notice: Undefined index: i in D:use_ide_1UniServerwwwgetproduct.php on line 2
Notice: Undefined variable: i in D:use_ide_1UniServerwwwgetproduct.php on line 7
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''..'' at line 1
This is the External.js
Code:
function getproduct(){
if(i=' '){
document.getElementById('f1').innerHTML=' ';[code]....
this works:
document.all[sResponseDivID].style.visibility = 'hidden'
this doesn't
setTimeout("document.all[sResponseDivID].style.visibility = 'hidden'",1000);
looks like sResponseDivID isn't recognized. what's the problem?
I need to load a content management system webpage on the front end system using .net, for that i'm storing my page URL's in sql database,
I'm now reading the page url using javascript and putting it in a variable, i now need to pass this Variable to my .aspx page using AJAX Call.
How can i pass my own parameters to ajax call and in response i need to print the content from the database in my .html page.
how to do this?
I have an array for of input names. Input1 , input 2 etc. Can I pass the input names in a loop like document.all[input].value="xxxx"
The problem is document.all cannot be used in Safari/firefox, I tried using document.getElementById but my inputs do have any IDs. is there any way of accomplishing thsse.?
I adapted Bresenham line drawing algorithm to draw a dashed line. I want to count the number of dashes. The dashes extend from one city on a map to another city. I don't want the dashes to obscure the city marker which is a small black dot, so I added some logic to skip dashes at the start of the line and at the end of the line. But this logic is confounding my attempt to count the dashes and I haven't been able to figure out why. The function should return the number of dashes as 'count'.
View 3 Replies View RelatedMy preview.php file which uses a watermark plugin is not loading correctly in IE 9, when I click the load button. It works well with other browsers. I have a posthttp2.php file
<html>
<body>
<form method="post" enctype="multipart/form-data" action="preview3.php">
<input id="button" type="button" value="load"/>
[Code]....
I am trying to minimize the amount of script that I use on my website. I have sections of each page; each section has the same basic layout. The divs and images that I want to make appear and disappear all have nearly identical ids, the only difference is the number at the end of the id.Is there a way to get one script to automatically detect which id number has been clicked and then show all elements with the same number at the end of the id? I would also like it to hide the elements in the hide function below (basically they are the elements that do not share the same id number).I currently have everything working the way I want it to using multiple functions like the one below but I woul
$("#2thumbNail2 , #ledBar").click(function () {
$("#type201 , #type203 , #type204").hide();
$("#image201 , #image203 , #image204").fadeOut("slow");
[code]....
I'm wanting a table cell click event to remove and replace the table it was clicked on, however I'm finding that as it's deleting the original table object the actual running event code is being replaced and the function is bailing.how I can call the delete/refresh function from outside the event's function scope?
View 1 Replies View Relatedhow I can accomplish wrappingrelevantparts of a script into a function then call that function within a success area on another page.
This is what I have so far: Script.js page - This page is longer but this is the relevant part that I would like to wrap:
$(".product img").draggable({
containment: 'document',
opacity: 0.6,
revert: 'invalid',
[code]....
I have just started learning JQuery and have a doubt in the below code. $.get('myhtmlpage.html', myCallBack);The doubt is should the 1st parameter of the get function be a HTML file or can it be a unction name?
View 1 Replies View RelatedI have a real perplexing issue. In two separate "projects" I had code that displayed checkboxes - when clicked, they would fetch information from a db and display it in the div below. I had code that displayed a jquery date-picker - when clicked, it would fetch information from a db and display it in the div below. My issue comes with this:
[Code]...
I have a document that can contain any number of iframes which have
further copies of the same document (and so on). In practice, we
shouldn't ever have frames within frames, but I'd like to make the
implementation a general case.
Various of the functions in the parent document need to call themselves
in the child documents with the same parameters as they've just been
passed.
Now, I can stick a loop in each function that goes throught the
window.frames array and calls the function for each frame, but for I'd
like to write a function to do this.
It's at this point that my brain explodes. If I limit it to a single
parameter we can do:
I'm in the middle of a JavaScript class, and I've run into a problem with one assignment. ^^; I've been given a pre-written script and HTML code to work with, and am required to modify it. Here's one thing I have to do, via my instructor:
Add an "email" field to this form. This field should also validate as a valid email address. (Hint: after adding the form field to the form itself, your next step will be to expand the function named submitIt() by adding a second if statement to confirm the contents of the email field. You will want to paste into the header and use the validEmail() function which you will find in Script 7.15, highlighted in red on pages 192-3 of your textbook.)
I know how to write the code to validate an email address, but I can't figure out how to call the validEmail() function in the submitIt() function. The code I have now just blanks out all the fields when I hit "submit." Here's the part of the script with the email validation:
window.onload = loadDoc;
function loadDoc() {
resetForm(document.forms[0]);
[code].....
<html>
<head>
<title>TESTING</title>
<script type="text/javascript">
[code]....
This is a very basic version of what I am trying to do. I have a dynamic list which is set in a table. When clicked, a function is run to set up a new list.. The reason I explain that, is that I need to keep it dynamic.Now for the problem:When I run this page, I have the button made right away, then when clicked it creates the new button. The new button should also run the function to create the new button again, but when I click it, I only receive "error on page".
I'm trying to "progressively enhance" one of my surveys using javascript. Basically, I have rating scales that make use of radio buttons as each point on the scale. Each radio button occupies its own cell in a table. I wrote some functions that will highlight cells on mouseover in a color corresponding to its position on the scale (e.g. the lowest point is red, the midpoint is yellow, the highest point is green). When a radio button is clicked, the background of the button's cell and preceding cells in the same row will be colored accordingly. The functions are working well in FireFox and Chrome (I just have to add a few lines using the addEvent function to make it compatible with IE).
The effect looks a lot nicer when I add a function that makes the visibility of the radio buttons hidden.
However, I want to make sure that there is a fallback option in case the functions that color the cells don't work for whatever reason. I would not want the radio buttons hidden in this case.
Is there a method whereby I can call the "hideRadiobuttons" function only if the other functions are successfully executed?
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]....