I have tow page and the first page open a new window with javascript(by using window.open).Now I want to call a javascript function that is in the first page from the second page and for that i use parent.function_name but it doesn't work.How can do so?
How to call javascript function in a web page?e.g. Putting the following code alert('test');in a web page will display the string "alert('test');".No alert box appears.
i have a function test() in a external js file i want to call it in my .aspx page how do i call it i tries using dim dv= externalfile.getfilters() ealier my function was in the same page and hence wrking fine dv= getfilters()
how to call my js function on the HTML page. This is a homework assignment and I've written the code but I just can't make it work. I can get the prompt boxes but the results don't show.
The assignment is to calculate basketball ticket prices. Each ticket has a base price. An up-charge or down-charge % is applied to the base price depending on the seat location. Courtside seats command a 20% premium upcharge Lower bowl seats have a 12% premium upcharge Inexpensive upper bowl seats cost 5% less than the stated base ticket price. If more than 8 tickets are purchased, 5% will be deducted from the total.
I have to use prompt() in my html page to prompt user for information. Then I'm to call the function to calculate the answers and build HTML to ouput.
look at what I have and offer advice as how to fix my code.
Here's my js file: function calcTotalTicketCost(baseTicketCost, totalNumberTickets){ var courtside = 0.20; var lowerbowl = 0.12;
like theres two pages.page one calls page two and displays the output of page 2 on page 1 via ajax.now can i click on page 2's output(on page one) and have it execute another javascript function to call AJAX(a third page)
I've ran into a little problem when using resize() function in jQuery as I am trying to call a function after the document loads and later on should window resize occur, but I can't really figure out use jQuery syntax to do the both at the same time within a function.
Here's a example: $(document).ready(function() { doScript(); $(window).resize(function doScript() { // do stuff }); }); So it is possible to give an instance name to this (resize) function and call it just once after the page loads?
Trying to call the same Ajax function twice on initial load of the page, but only the second one executed. I try to load mainpage, and inside mainpage I try to use ajax to load content1.asp to div1 and content2.asp to div2.
Test scenario (based on the Situation below): - Page loaded, 1st ajax function skipped, 2nd ajax function loaded - Remarked 1st ajax function, then 2nd ajax function loaded - Remarked 2nd ajax function, then 1st ajax function loaded - Moved the 2nd ajax function to above 1st ajax function, the 2nd ajax function is skipped.
Conclusion: - the 1st ajax function always skipped. But Why? How to ensure both ajax is called upon loading of the page?
I cannot call a function more than one time in my page, the function is:
Code: <script> function seeBig(_this) { document.all.view_img.src=_this.parentNode.getElementsByTagName("img")[0].src; }
[Code]....
what problem I am facing is, if I want to build another table as the same as the one above, the function will not work. I know I might need give the function an ID
I have a web page a lot of thumbnail images arranged in a table. I would like the user to be able to click on the thumbnail to open a window with a larger view of the image.
So I wrote a JS function to accept a URL as the argument and open a new pop-up window with the given parameters. I need this function to potentially run multiple times from multiple links (in this case images) on the same page. However, after the first time I click the link, the function runs, and I close the pop-up, the function will not run again if I click the same or another link on the page. If I refresh the page, the function will work once and then not again. Is there a buffer I need to clear or something to reset to allow multiple links to work?
I have tried the function call in a whole slew of ways. Here's my current code (I "..."'ed out the URLs for brevity):
I would like to include drop-down navigation links on my home page that connect to other pages on my website. No problem there. The problem is that some of the other pages contain a series of div elements that are hidden (display:none) until activated by javascript enabled links on the page. Clicking those links changes some of the page's content (within a div) .. almost like a "new" page. [URL]. Here's my question: Is there any way to create menu links on my home page that will open the "concert.html" page AND display the appropriate div content at the same time? For example: on the home page, a menu link under "Concert" that opens that page and automatically displays the "Rock Symphonies" section?
Here are the related HTML div elements on the "concert.html" page: <div id="page1">concept content</div> <div id="page2" style="display:none;">rock symphonies content</div> <div id="page3" style="display:none;">general program content</div> <div id="page4" style="display:none;">ticket price content</div> <div id="page5" style="display:none;">concert committee content</div>
Here are the corresponding js-enabled links: <li><a href="javascript:page(1,5);" id="tag1">Concept</a></li> <li><a href="javascript:page(2,5);" id="tag2">Rock Symphonies</a></li> <li><a href="javascript:page(3,5);" id="tag3">General Program</a></li> <li><a href="javascript:page(4,5);" id="tag4">Ticket Prices</a></li> <li><a href="javascript:page(5,5);" id="tag5">Concert Committee</a></li>
And here's the javascript I'm using: (scripts/generator.js) function page(id,all) {for (i=1; i<=all; i++) { if (i==id) { document.getElementById('page'+i).style.display="inline"; document.getElementById('tag'+i).style.fontWeight="normal"; document.getElementById('tag'+i).style.color="#FFF"; } else { document.getElementById('page'+i).style.display="none"; document.getElementById('tag'+i).style.fontWeight="normal"; document.getElementById('tag'+i).style.color="#a4bfed";} }}
i have an iframe inside a page(main). In that iframe, i am calling a java script function that is in the main page.This function call is working in Mozilla , IE but not in Safari and google chrome?? Is there any specific reason for that? when i add the function in the iframe it works.
<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
What I want to do is change the border of several images on the page to show a 4px border. There are many images on the page so I just want to call the changeborder() function on the onClick event so as the image that has been clicked changes. However, I don't think using this.style.border to identify the element works when placed within the function. That is, how do I identify, from the function, which image has been clicked? My current code (which does not work) looks like this but I am sure its possible to gather what i'm trying to achieve:
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?
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?
I 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.
I 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:
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]);
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")