Linking External JS...
Jul 20, 2006How do you link in external js file from a current js file? i went to do it with <script> tags and remembered i wasn't in html.
View 8 RepliesHow do you link in external js file from a current js file? i went to do it with <script> tags and remembered i wasn't in html.
View 8 RepliesI am trying to link to an external URL and have confirmed that the link is good (I can paste it in the address bar of my browser and it goes fine). But I need to surround the link in hyperlink tags so the user can click on it to go to the URL from my web page. Here is the code:
td.innerHTML = "<a href="http://TESTSERVER123/reportserver?/Data_Analysis/Billed_Charges_Per_Customer&rs:Command=Render&CustomerId=" + customer.TIN + "" target="_blank">" + "</a>";
I have been researching the syntax on this and from what I can gather I am probably not escaping the slashes properly in my link, but I am stumped at this point.
relatively new coder here definitely new to js and I can't figure out how to get this script linked into an external file every time I try nothing shows up.
<html>
<head>
<script language="JavaScript1.1">
<!--
var slideimages=new Array()
var slidelinks=new Array()
[Code]...
do i need to break this up into 2 files or something I can't get it to work
I have an existing javascript menu where the user selects a meaning from a drop down box and a list of products with that meaning appear in a search results page.
I had the whole javascript pasted into one of the columns where I wanted the 'search by meaning' box to appear and it worked fine, however when I tried to validate the HTML (4.01 strict) it popped up errors left and right because it was interpreting the script as HTML.
I don't know how to write js or work arounds, so I removed the whole script from the page and saved it in a .js file, but I am doing something wrong because I cannot get the javascript to appear at all, nevermind getting it to appear in the column I want it to. Code:
I'm trying to link to a jQuery tab (the second tab) from an external source and havent had much luck so far. I found this on the jQuery UI demo's page:
...select a tab from a text link instead of clicking a tab itselfvar $tabs = $('#example').tabs(); // first tab selected $('#my-text-link').click(function() { // bind click event to link $tabs.tabs('select', 2); // switch to third tab return false;
});
But cant figure out what I should be putting in "#my-text-link
", what is itreferringtoo?
My second tab is called '#tabs-2' so I assume that's what I place into'#example'
?
when link from first thumbnail there's no transition.. I would like that same effect when link from any other thumbnail.. i.e., fx:'none' when linking from any thumbnail.. looked in FAQ, found examples for linking from external controls, but none to eliminate transition effect when linking from any ext control..
View 5 Replies View RelatedI have put together an image gallery that contains links to each individual image, however, I would like to link to individual images on a separate html document and cannot for the life of me determine how to go about doing this.
rnmix
Code:
<html>
<head>
<script type="text/javascript">
[Code]....
I am trying to link to a specific nested tab fromanother page. So let's say I'm on the home page, and I want to link to: productspage > Widgets (parent tab #2) > Large Widgets (Parent tab #2's child tab #3). In other words; Directly to a non-default nested tab, from acompletely different page. Linking to the parent tabs works fine (with a standard anchor link e.g.; [URL]), but I can't figure out how to link to one of their child tabs (besides what is set as default)
Here is a stripped down version of the setup I have (I just typed most of it out, so forgive any obvious syntax errors, my pages on the site all validate):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"[URL]">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Site Title</title> .....
//-----10% Off Coupon-----
if (coupon=="N110"){
form.PRICE.value=-(moneyFormat(fTotal * .10)-1);
form.ID_NUM.value="N110";
form.NAME.value=" Craft Month Promo 10% Off";
location.href=location.href;
return true;
}
I want to replace the .10 with an external peice of data, so users can change the amount with having to open the script. Sorta like those early marquees' where the marquee text was inserted from a text file.
I've got this code:
<html>
<head>
<style>
a{cursor:hand;text-decoration:none;font-size=10pt;font-family:Verdana;}
a:hover{cursor:hand;text-decoration:underline;}
</style>
</head>
<body>
<a href="" onClick=openR()>link1</a><br>
<a onClick=openR()>link2</a><br>
</body>
</html>
And I'm wondering why on the first link the css is working fine and on the
second one fails. Anyone know's?
Is it possible to link to a html doc using a javascript command? I don't wish to use any js in the <head> part of the html page, but just using a single javascript statement..
Something similar to
javascript:top.document.location.href='Link.htm' onMouseOver=window.status='yellow'
return true">
I need to use a code similar to this as I am trying to intergrate it into another script and can't use quotes.
i have two pages titled: abc.html and program.html. in "abc.html", i have an image and a submit button. the image is a link that when clicked takes us to "program.html" page
in program.html, i have a form with select tag and some options. i have a function (say choose()) that displays the results as a new window.
now i want this choose() function to be executed only when the user clicks on the submit button in the page abc.html. how should i proceed? the sequence of program execution is as:
1) the user is first displayed with the page, abc.html having an image and a submit button
2) he clicks on the image present in this page and is taken to the page "program.html"
3) in program.html page, he has a form with select tag
4) the user just chooses his option and then clicks on a back button and returns to abc.html
5) here he clicks on the submit button and a window that displays the options he has selected is to be displayed.
Can I link from an external .js to another? If so, how do I do it.
I'm sure I've seen this topic before, but I took no notice then as I didn't need it!!
How can I use Javascript to look at variables passed from another page
using the GET method( a website address) and load that website?
I am working on building a site so people can get the latest reports. I am working with the existing folder architecture. Here is how the folders look.
SalesRev >
old (this is a folder inside SalesRev) salesPDF_80811.pdf (This is today's file that is in the same folder as old) I will not be able to link to the full file name sense the date will change each day. Is there anyway to link to the beginning of the file name
I have a simple script that will get the NWS forecast for any zip code and it opens it in a new tab. I would like it to open in an iframe on another page with in my website. I have come close, but not quite all the way yet. This will enter the forecast in an iframe on the same page as the input form. [URL]
How can it load onto this page from the form on the menubar? This menu is common on all the sites pages.
I have seen solutions posted around the internet using javascript for similar issues, but I haven't been able to get any to work in my situation. My javascript skills are - none.
I would like to be able to open a new page in the same window when the user continuously hovers over an image for 1 second.
View 8 Replies View RelatedI have to create a website which features Javascript. I created a calendar which shows small images for specific dates (trying to keep it interesting, hearts for valentines day etc...). Text looks quite dull.
Anyway, I was able to get the code to work successfully, when the image is linked absolutely to the file. However, if I try to change it so that it's relatively linked to the file, it appears as a broken file. This wouldn't normally be a problem, but I have to transfer all of the files to a disc, and so the images will end up broken.Is there anyway I can link the files without them appearing broken? I've tried most things I can think of.
Sample code:
// New Years Day
if (m==1 && d==1) {
objEvent = new EventObj(m,d,y, "<center><img src='file:///E:/ICT/Website/mysite/Balloons-32.png'>
[code]....
I think that the way I have worded the title may be incorrect, as I've googled similar phrases without finding anything to help me Anyway onto the issue
I have a dropdown menu
you can see it here:
http://heavywoollen.webs.com
It's written in html & css, now I've had to put the code for the dropdown onto every page of the site, simply because at the time that was all i knew how to do, so I'm now trying to reduce it by writing it on JS and link the file into the page so the issue/question
[Code]...
i know how to use javascript to make a specific page load into an iframe but not how to make the page load into the iframe on another page. all i need to know is how to do it for one page then i think i can build the decision structure around it to make it work for more than one link (hopefully).
View 24 Replies View RelatedI found this script embedded on a website and it displays a window with an image that links to another website:
Code:
<script type="text/javascript" src="[URL]">
Anyone know where I can find scripts like that or tutorials that show how to write a script like that? I'd like to embed some links to other sites from my website. I would say I have level 1 knowledge of Javascript
I need the following link to automatically scroll to the top of the page when it is clicked.
[Code]....
i got a webpage that links to 4 diffrent scripts but only one work at a time.
View 2 Replies View RelatedI am having trouble with a project i am supposed to be doing which is to turn structured English into coding joined with the code i am about to post !This is the code i have written so far that works:
var contestantNamesArray = ['Tom and Nazia', 'Pat and Dan', 'Sandra and Kofi', 'Ian and Adele', 'Paul and Costas'];
var judgesPointsArray = [2,1,5,4,3];[code].....
I have tried myself but i am stuck at how to link the contestantNamesArray with the rest of the code in order to be able to display the couples who scored the maximum points and store it in a new variable and then write out the names.
I have 3 bits of code, 2 of which I'm pretty sure are right [i know the php works, and the ajax looks fine], but one i'm having trouble with. Basically what I'm trying to do is use a link to call php function [calls a piece of text from a database]. Which worked fine. But then I tried to incorporate AJAX into the script to make change dynamically on the page, and I'm a little confused with it all. I've got the AJAX and PHP, [and an attempted page with a link on to try and call the function with AJAX] but so far it's not doing as it should. Wondered if anyone could show me where I'm going wrong with the whole 'linking together' thing? So far everything I've tried hasn't worked. [hope this doesn't violate the forums 'don't dump your code' rule. But it's kind of all necessary]
[Code]...
I'm using the niceforms plugin to style my select box. The problem I'm having is that I can't get the right javascript code to activate the links placed in the value option.
el.lnk._onclick = el.onclick || function () {
if(this.ref.oldClassName == "NFOnChange") {
//insert your code here
}};
This is my attempt at manipulating the code to allow url linking in the select drop down
el.lnk._onclick = el.onclick || function () {
if(this.ref.oldClassName == "NFOnChange") {
//code i added
window.location.href = $(this.ref).val();
}};
The PROBLEM is the links do not work as expected, they do not link to their corresponding values.
form class ="niceform"
select class ="NFOnchange"
option value = "http://link1.com" -> link1.com
option value = "http://link2.com" -> link2.com
option value = "http://link3.com" -> link3.com
i just need to insert the right bit of code to make the links correspond to their option values.