Creating Variables From Page Content?
Jan 27, 2006
I have an e-commerce site which is hosted and I'm not allowed to place any server side script on, nor am I allowed to access any server side variables. I need to be able to create variables based on page content (i.e. order total, products, quantities) and send them to my web analytics program.
Does anyone know if this is possible?? Or do you have any idea how I can gather the information that I need?
View 1 Replies
ADVERTISEMENT
Jul 20, 2005
how you would piece
together a variable name and then assign it a value. I want to create a
hidden field and assign it a value based on the value of another variable
Right now it looks like:
("document.all.SM_MARK_10" + dateNumber + ".value")
where dateNumber is an already defined integer. What I want is to say
document.all.SM_MARK_1001.value="XX"
document.all.SM_MARK_1002.value="X2"
etc.
based on that value of dateNumber. Any way to do this easily?
View 22 Replies
View Related
Jul 17, 2007
I have a flash object count down clock, that uses the following:
value="server={NOW}&localtime={LOCALNOW}
I need to somehow put the server time and localtime into a javascript to use with the above. The variables should be in Unix time. Does that some sense? I'm starting to google out some javascript time examples, but haven't quite gotten it figured out yet. I think its probably alot simpler than I'm making it out to be.
View 4 Replies
View Related
Jan 7, 2010
I'm trying to create a family tree online that has several other related family charts. I want each person's name and birth year to be stored in javascript variables, then I want to be able to just go through the tree, and put the persons name once, and have it put the appropriate name and birthyear in the little boxes that the css is creating.
var johnname = "John Smith";
var johnbirthyear = "Jan 1 1930";
var janename = "Jane Doe";
[code]....
So I thought I had it all figured out. I thought that the above would take the id of John that I added, go to the line that sets the name, add john to the word name, and then document write the variable of johnname from the js file. I know you're laughing at me because of course it instead made the value of name to johnname, then wrote the word johnname in the box. I want to go through and be able to just type the persons name in the html for that box once, and have it update with their appropriate info.
View 8 Replies
View Related
Mar 29, 2011
how to store variables in cookies so that I can later use them in php code.Here is the basic javascript I want to use:
Code:
function alertSize() {
var myWidth = 0, myHeight = 0;
if( typeof( window.innerWidth ) == 'number' ) {[code]....
Now, I want to save myWidth and myHeight in a cookie(s) but I don't know how to. The window.alert() will only be for testing purposes and will not be needed in the final code. I also need to know if the codes need to be in certain sections such as <head>, etc.]
View 1 Replies
View Related
Apr 18, 2011
I'm having some trouble with the Switch Statements. My program runs without it so I know that the problem is here. I believe the logic is sound so it may be due to incorrect syntax. The purpose of this function is to create bars, and the length of the bars is determined by the value of the "percent" variable (which is working fine) in the For loop after the Switch statements. The variable, "partyType" contains any of the text strings, such as "I", "D", etc.
function createBar(partyType,percent){
var barText;
switch(partyType){
case "D":
barText="<td class='dem'></td>";
break;
case "R":
barText="<td class='rep'></td>";
break;
case "I":
barText="<td class='ind'></td>";
break;
case "G":
barText="<td class='green'></td>";
break;
case "L":
barText="<td class='lib'></td>";
break;
default: document.write("hi");
}
for(var i=1; i<percent; i++){
document.write(barText);
}}}
View 1 Replies
View Related
Jan 18, 2010
I am creating a game which will need to create arrays and store variables for thousands of different users. I have created about 15 functions that will need to store their changes to variables so that the game can progress.show me a simplistic way to store a variable altered or created in a function longterm?
View 1 Replies
View Related
May 25, 2011
i need to make a vertical menu which load different images/text on the right side of the menu. i need to do it in ajax. how can i achieve it?
View 4 Replies
View Related
Aug 5, 2011
I am currently working on creating a vertical scroller and have got so far but have got stuck on some of the functionality.
My HTML looks like this
div class="outer">
<div class="slider-content clearfix"><ul>
<li><img src="images/img1.jpg" width="200" height="200" alt="img1"></li>
<li><img src="images/img2.jpg" width="210" height="200" alt="img2"></li>
<li><img src="images/img3.jpg" width="220" height="210" alt="img3"></li>
<li><img src="images/img4.jpg" width="210" height="200" alt="img4"></li>
<li><img src="images/img5.jpg" width="200" height="200" alt="img5"></li> .....
My CSS is as follows
*{margin:0px;padding:0px;}
li{list-style:none;float:left;height:200px;width:200px;}
.clearfix { overflow: hidden; display: inline-block; }
.clearfix { display: block; }
.outer{margin:45px auto;position:relative;height:500px;width:515px;border:1px solid #333;overflow:hidden;}
.slider-content{position:absolute;top:0px;left:0px;}
.top-hover, .bottom-hover{width:515px;height:50px;background:#ccc;}
.top-hover{position:absolute;top:0px;z-index:500;}
.bottom-hover{position:absolute;bottom:0px;}
And finally my JS
$(function(){
$('.outer').prepend('<div class="top-hover"></div>');
$('.slider-content').after('<div class="bottom-hover"></div>');
//Get height of outer container and slider
var outerHeight = $('div.outer').height();
var contentHeight = $('div.slider-content').height();
// Calculate cut off point of displayed contents
var contentExcess = contentHeight - outerHeight;
//store end point of scroll
var maxTopScroll = 0 - contentExcess
var speed = 45;
var hovered = false; .....
//If scroll reaches max then stop
alert('No movement');
}},
function(){
return false;
});});
Currently the scroller moves up and down when you hover over the top and bottom buttons however you have to keep moving in and out of the hover area in order to get the scroller to move. How can you make it so that it will do a continuous scroll of the scroll-content div. Also currently the script has no way to limit the end of the scroll-content div and I cant seem to get it to stop once it gets to the bottom of this div.
View 2 Replies
View Related
Dec 6, 2011
I am trying to create a menue that takes elements with one of the following selectors .cata, .catb or.catc and fades all not matched elements out while fading the matched elements in (if already faded out). When one of the links ist clicked a second time (in faded in status) then all elements .portfolio (.cata, .catb and .catc) should be faded in.verything is working like charme. The only problem is, that I can't get all elements .portfolio displayed, when I trigger the link a second time.Here is what I did in jquery:
$(function(){
$('.aktiv2').click(function(){
$(".cata, .catb, .catc").css({opacity:'0'}).show().animate({opacity:'1'},{duration:600});
[code]....
View 1 Replies
View Related
Nov 18, 2010
I have several drop down lists of links with one of the drop downs being a "My Favorites". My intent is that when the user clicks on a star image next to the links, it is cloned and appended to the favorites menu, where it can then be drag and drop sorted. To remove the link from the favorites menu, the user can either click on the "x" button to the right of the link on the favorites menu, or unselect the star on the main menus.
I have successfully cloned the link and appended it to the favorites menu by selecting the star and enabled the drag and drop sorting, but I am having trouble removing the link form the favorites menu when unselecting the star and when clicking on the "x". Here is what I have so far:
var me = '';
$('div.star').toggle(function(me){
var me = $(this).next('a').text();
$(this).addClass('favorite').next('a').clone(true).appendTo('ul#myFavs1').wrap('<li></li>').before("<div class='dragHandle'><img class='png' src='_images/dragHandle4.png' width='11' height='11' /></div>").after("<div class='remove' title='Remove from Favorites'></div>").attr('id', me); return me;}, function(me){[CODE]...
So, I clone the link, wrap it, add a drag handle and the 'x' button, give it an id of the text of the link which all works fine. I have a different part of the script that uses the drag handle to drag and drop the links...that works fine. The issues I am having are that unselecting the star does not remove the link from the favorites drop down and clicking on the 'x' does not even fire the alert. The z-index on the 'x' is higher than all the other elements in the li.
View 2 Replies
View Related
Mar 18, 2010
I have content in hidden (invisible) DIV elements on a page that I want to load into another DIV element on same page. I need to replace content currently in a DIV with that coming from another DIV. DIV ontent could be a P element or a P and IMG element.
View 4 Replies
View Related
Dec 6, 2005
Can I create a frame in the same page without referring to other html
files? I.e., I have a large dynamically created table in my JSP page. I
would like to place it inside the scrollable frame. If I put the whole
table into a separate file, I can easily do it by referring to that
HTML file from the 'src' attribute. But what if I want to create this
frame in the same page without referring to the outside html files?
I tried to place my table content inside the anchor link and then refer
to it from the frame like this:
<frameset cols="200">
<frame src="#framed" scrolling="yes" frameborder="1">
</frameset>
That obviously did not work.
View 1 Replies
View Related
Nov 18, 2010
I am trying to transfer the variables of the form (username & password )in the html page to the process.php page which are both given below. However I am not able to read those values from the process.php page.
HTML Page
<!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">
[Code]....
View 14 Replies
View Related
Jun 10, 2011
I want to pass 2 variables from a html page and collecting in another html page using javascript. Say I pass xyz and abc to a page 2.html from 1.html without using cookies. In 1.html page i have many links. each link should be able to pass different variable to 2.html. When some one clicks on a link the variables should be passed to 2.html. I want to know how to collect them and use them.
View 4 Replies
View Related
Jun 2, 2010
I'm creating a small e-commerce store where things live coupon activation will be done on the client side(That's without loading the page). My problem is that I don't know how to pass the coupon deduction to another page using javascript. Is there a way out using javascript or is it possible to pass javascript variables to a server side language like PHP.
View 7 Replies
View Related
May 10, 2010
if I am loading content into a div using the get feature of jquery, and that content has some clickable objects in it will jquery recognize those as well? What I am doing is building a site that tracks bugs on our software. The site pulls the bugs from a mysql db and displays in a table format. There's an edit link which passes the record id number of that bug (via ajax) to a php file, where a form is filled in with the bug data and passed back, a hidden div is then shown with the form in it. Part of the code I pass back has a submit button and a close button (css styled anchors) and I'm using the same process on them as I am on the edit link but not getting any results. My script looks like this:
<script src="js/jquery.js"></script>
<script language="javascript">
$(document).ready(function(){
//hide edit form
[Code].....
how it works. Does it sneak peek the page after it loads and get all the objects into some sort of array? I'm thinking it is doing that and because I am adding other object through AJAX it is not seeing those, since the page is not being reloaded.
View 1 Replies
View Related
Oct 17, 2010
I'm new to java script and am desperately trying to understand it all. My first question is, I'm trying to create a "rotator" for my companies home page, much like the one on [URL]. And by rotators, I am referring the the deal that right underneath the nav bar that is rotating pics, etc. I found one I like at a different site as well, so I talked to the web developer and he graciously supplied me with the java script code for it. The code is fine, but when I place it in a document, it has the pics and text underneath each other instead if rotating the pics.
View 1 Replies
View Related
Dec 21, 2007
I'm looking to create a processing page for a submit that has a little rotating processing image with a little verbage like "please wait while we process your information" Just so the page looks like it's actually doing something. Code:
View 1 Replies
View Related
Oct 24, 2005
I have an XML document which lists some information about movies(Title, actor, etc.) I am using Javascript to pull that data and display it as html. Is it possible to create a link for each one of those titles that are pulled from the XML in my JS? Here is my code:
for (var i=0; movies.length > i; i++)
{
var Title = movies[i].getElementsByTagName("title");
var Actor = movies[i].getElementsByTagName("actor");
var Price = movies[i].getElementsByTagName("price");
results += i+1 + '. ' + ' "<span class="title"><a href="http://www.imdb.com">' + Title[0].firstChild.nodeValue + '</a></span>"' +
' starring <span class="actor">' + Actor[0].firstChild.nodeValue + '</span>' + ' and costs approximately $'+ Price[0].firstChild.nodeValue + "<br/>
";
}
document.getElementById("displayresults").innerHTML = results;
View 5 Replies
View Related
Sep 4, 2011
I am creating a HTML page and mailing it to the user(client side). This html page contains a Table and a button. On button click, I would like to create another HTML page based on the detail in the table,dynamically on run time and Open the newly created HTML. I need to use javascript to achieve this functionality. I have no Server-Client Configuration. And I need to run the Javscript only on client side to process the First HTML's table data and Create a new HTML page. The output of the javascript should also be put in a table format in the newly created HTML page.
Here is some background information: The details from one server would be put into this first HTML along with a button. This HTML page is then mailed to Client side. The javascript in the HTML page then processes the Table data of first HTML. This can only be run at Client Side,once the user clicks the button and moreover I dont have Server-Client Configuration. I am creating a report and mailing it, For formatting purposes and for creating hyperlink to mailid's I chose HTML.
View 7 Replies
View Related
Dec 24, 2009
i need to pass variables to a popup page. I have already made the page i want to be popped up, it is called popup.html and is in the same file location.Here is how i am making the page popup:
<head>
<script type="text/javascript">
function prizes(){
[code]....
View 6 Replies
View Related
May 24, 2010
I want a page with a hyperlink that passes a variable to another 'pop-up' page (in this case a name, its just an example) and new pop-up page prints a message followed by the variable thats passed.
Here is the code as it is right now
<html>
<head>
<script language="javascript" type="text/javascript">
function popitup(a)
[Code]....
In short, I just want the pop-up page to print 'Hello there Toby' or whatever name I choose to pass across. The 'testpopup.html' url is just the initial webpage.
View 2 Replies
View Related
Jun 19, 2011
I have a form with allot of form items on it that posts to itself. I am trying to pass those form values to another page with out using the action attribute in the form. Is there a way to do this? I have tried jquery and javascript but coming up blank. Just trying to pass all the values at one time to another page. Seems a little difficult to me since im a intermediate javascript programmer. Here is what i am trying to do script wise. theform is the ID of the form. I have a switch statement that is based on the button pressed would get into that statement. So if one of the three buttons on the page is "excel report" it should get into that statement and pass the values of the form to another page. I have tried this:
[Code]....
View 9 Replies
View Related
Aug 14, 2009
I need to cache some javascript variable values across the page. Consider page 1 has a javascript variable which holds some value and If the user take page 2 and clicks the browser back button the javascript variable value on page 1 will be lost. How can I cache the javascript variable value on page 1.
View 3 Replies
View Related
Mar 18, 2010
Attempting to develop [URL] The site uses the onclick() to call a random link.All the links seem to be heavy on the page.Is it possible to store them elsewhere, like a separate webpage?
View 4 Replies
View Related