External Var - Replace The .10 With An External Piece Of Data
Mar 8, 2011
//-----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 am working on JS navigation for my web page. Contents of 3 subpages are located in the array as shown below. When certain key is pressed on the page, div is filled with data taken from one of the array rows.
*** var content=new Array() content[1]='<p>some text</p>' content[2]='<p>some other text</p>' content[3]='<p>yet another text</p>' ***
The question is: is it possible in some simple way to put the data from those 3 rows into 3 separate files and make the JS code to take the data from those files? (I want to have 3 files with plain HTML) If so, please show me some example how to do that. Or give me some address where I can read about it, please. I have been using Google for several hours - unfortunately without any luck.
In general - here is what I would like to do:
*** var content=new Array() content[1]=[contents of Ƈ.html' file] content[2]=[contents of ƈ.html' file] content[3]=[contents of Ɖ.html' file] ***
well i'm kind of new to this website and scripting with javascript but i am wondering: in a client side .js file i have some coding which results in a string which is stored in a variable called exportData
now i want that string to be written into a text file on a server but how do i do that? it is not local on the client's pc and i can't find how to do it anywhere..
how to load an XML file into a DOM. I can get it done in IE, but in mozilla I am missing something. Here is what my loadXML() function looks like:
function loadXML(){ try { xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async = "false"; xmlDoc.onreadystatechange = verify; hasFile = xmlDoc.load(info.XMLDocument); if (hasFile){ xmlObj = xmlDoc.documentElement; allTopics = xmlObj.getElementsByTagName("topic"); }} catch(e) { xmlDoc = (new DOMParser()).parseFromString(document.getElementById('info').innerHTML, 'text/xml'); hasFile = true; allTopics = xmlDoc.getElementsByTagName("topic");
if (hasFile){ allTopics = xmlDoc.getElementsByTagName("topic"); alert(allTopics[0].firstChild.getAttribute("name")); }}}
Where verify is another function. The try part works for IE, but the catch part doesn't work for Mozilla. I am not finding any information as to really use an XML DOM properly in Mozilla. I'm trying to get allTopics to be a handle on the same thing in both the "try" and the "catch".
Scenario:i have a user form, and want to modify user details. all user details are from json file. Prob:how can i modify external json file with its updated user details? or what available function to be used?
is there a way of sending data inputted into a form inside a chunk, to an ASP form on a completely external page (i.e on a different, unrelated site)?This is the code I have for the form chunk:
I hav linked external js (ext1.js) to my app.html page. Now in the ext1.js, I have a function like
[CODE] function onwindowload(){ //Access HTML element and append external js 2 (ext2.js) here }[CODE] //Access HTML element and append external js 2 (ext2.js) here--->I donno how to add external JS here.
Even if i add the external JS here, the JS uses document.write fn. which replaces entire page.
I'm working my way through Sam learning:Xhtml in 24 hours and am need a little help with the rel="external attribute.
I've tried the code written in the book a few times and I just can't get it to work! I've also tried google for an answer but again I can't see anything that I'm doing wrong! Code:
I want only one external javascript link on each of my pages. However, I'll be using Clicky and other programs where it's own external javascript is needed. Can I put an external javascript in another external javascript?
very new to this (javascript and the likes) so this might range in the dumb cataegory. when i am saving my external javascripts on the same server as all my HTML and Perl, etc scripts, what is the proper permissions to set the JS files at? i.e as in Perl scripts should be 755..
I have this table cell that is 150 pixels wide. In it I desire to call an external javascript file to print on the screen, in this cell, a menu and to jump to a page when the corresponding button is pressed. I am trying to have all my button layout and linking happen in the javascript. I am wanting to do this in javascript so I can easily add or delete page links by just updating the javascript page instead of having to re-compile a java program or change a bunch of html pages. Is this possible or am I just dreaming?
I have a small script (it prints the date in the UK fashion ) that i want to include on several but not all the pages on my web site. it seems illogical to type all the code on every page, I understand I can put the code in a file lets call it do_date.js and have it used by the pages it is needed on, i just don't seem to be able to get it to work.
I'm working on a web app that, after reading an user submitted url, return the colors of bg and fg for any element of the page.Actually I can view all the html code of the page in a specific div (XMLHttpRequest responsetext and innerHTML) but...with responseText I can't access dom, and... I can't use responseXML due to the page is in HTML format...
Here are the scripts I am trying to call to the HTML page......The CSS works fine no problem.....I have been working on this for a while, I am no expert but, have been looking at this for so long and can't figure out what the problem isHere is the web page:
I have a PHP page with a number of images displayed thumbnail size. I want the image source of a clicked thumbnail to be the image source of a larger image in an image field. Javascript is here:
<script type="text/javascript"> function getValue(VarSrc) {
I'm having a bit of trouble understanding something that seems relatively simple. When I make changes to CSS in JavaScript using '.style' I'm changing the attribute values of inline CSS. Can I use JavaScript to change the attribute values of rules in an external CSS file? I have no CSS in my html and would like to know if I can grab the values of attributes in an external CSS file using JavaScript.
I have a webpage where I would like to load an external FLV (video)The plan is to have a DIV that sits above the webpage (top/left) that plays until the end, and then it fades out.I have managed to do the FLV and the CSS but not the coding .
I have a php pages where i want to put the js script as externaly. i have this code but not working. If i put the code directly in the head area then works but externaly linking is not working.
Now blah .jsp is included INSIDE index.jsp. In blah.jsp I have a button that calls a function inside b.js. In index.jsp I have following code inside head tags:
and I figured since blah.jsp is included inside index.jsp, I should be able to access the javascript methods with ease. But its not happening that way. I get an error (object expected in the line that has button in it). BTW, its not a problem in my JS or JSP code, because if I put the js file's contents inside blah.jsp, then it works like a charm!
So what am I doing wrong?
I also tried moving my script import statements inside blah.jsp as: