Build Multipage Javascript Interfaces
Apr 12, 2006i want to build an app that has multiple pages and wondered the best approach to it, how does gmail for example change its central content?
View 6 Repliesi want to build an app that has multiple pages and wondered the best approach to it, how does gmail for example change its central content?
View 6 RepliesI've got the following problem: i need to build a "progress bar" with
JavaScript. So far i have the following configuration: i've got a DIV
inside of a DIV. Each DIV has a style attribute that defines its width and
other style information.
I need to calculate the size of the incremental block based on various
factor like Width of the outside DIV, incremental interval and number of
increments. My original solution was to assume that all of the units are in
'px' so i could just deal with integers. However now i hit a brick wall,
when i realised that this is anything but scalable.
So what i need to do now is to obtain a width of the DIV from its style
attribute (had it hard coded before), do the calculation, and then use the
result to increment the size of the inner DIV (width element in the style
attribute)...
The code I have so far looks like this:
Code:a href=index.php?cat=$row[name] onClick=java script: content.location.href = 'disp_cat.php?cat=$row[name]'$row[name]/aIs this possible? As you can see, I am trying to send a variable to index.php (main Page) and disp_cat.php (iframe) in one click. $row[name] gets it's value from a database.
My problem is with the javascript. What do I need to do in order to pass a variable to an iframe with Javascript? What I have written above doesn't work...
I am trying to create a multipage form that will validate at each step and stop the user from moving forward if an error is detected. I am able to have it step like a multipage form with javascript and validate each page but it will not stop at the page that has error. The goal is to stop the user from moving forward if the validation detected error on that page. I am using phatfusion.com's validation code for this.
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "[URL]">
<html xmlns="[URL]">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>validate</title>
<link rel="stylesheet" href="../_common/css/main.css" type="text/css" media="all">
<link href="validate.css" rel="stylesheet" type="text/css" /> .....
Validate.implement(new Options);
Validate.implement(new Events);
I have a project involving a multipage form with a text resizing function. I'd like to be able to keep the size the user selects as persistent throughout the multipage form (on other pages).
I tried creating a hidden input form and passing the value through it, but for some reason, it didn't work (it's a proprietary templating tool they're using). Am I missing something, or is there some easier way of going about this?
Just in case you're wondering, here's the code. It works beautifully, if only I could keep the font size. function ResizeText(resize)
[Code]...
Multicolumn text flowing through multipage sliding, should calculate total column, gap, text size, image size for different browser. To be control with Previous Page & Next Page. At the ending of story the next Page sliding should stop. How to implement with CSS, javascript, jsscript, if any...
View 4 Replies View RelatedI've generally built a JavaScript file for each "class" I want to build. So, each class would look something like:
Person.js
Code:
function Person()
{
var self = this;
// variables
this.XmlRequestPerson;
// methods
this.loginPerson = loginPerson;
function loginPerson(userName, password)
{
// do some stuff!
}
}
Having a class like this gives me the opportunity to do something like:
Code:
var person = new Person();
person.loginPerson("sup", "dude");
Are there better ways to do this? It just seems like the "var self = this" thing is stupid, because inside the Person.js file I have to reference everything local by "self" instead of "this".
I am new to javascript and intend to build a custom library. After
saving independent files which contain separate functions, how does one
build the library?
I have a problem with new class implementation used with jQuery.in standard as far as I know my objects can be defined as follows:[code]will not work because 'this' refers in this case to results from xml....so how can I do it?How can I refer to property of the object PicturesList?
View 1 Replies View RelatedI want to create a 'go forward' and 'go back' link on each of roughly 100 pages. Rather than insert a hyperlink (a href) I would like to build it from an array or list, because the actual links may change. So I was hoping there may be a way to do something like this: link xxx.html+1 or xxx.html-1 I have no idea if this is even the right forum for this!
View 1 Replies View RelatedI am having a terrible problem with animation build up.have searched and found various codes to stop,but can't implement in the .js in a way that works.
var droplinemenu={
arrowimage: {classname: 'downarrowclass', src: 'down.gif', leftpadding: 5}, //customize down arrow image
animateduration: {over: 200, out: 600}, //duration of slide in/ out animation, in milliseconds[code].....
Is it possible to build a forum using Java-Script and HTML??
View 3 Replies View RelatedCan we build a treeview which is bound to an XML using JAVASCRIPT and add/delete/modify nodes?
View 1 Replies View Related[URL] This site has a filter on it to sort by different industries. I see there is a lot of CSS done with it but not sure exactly how they built it
View 7 Replies View RelatedI want to make a page that displays content based on values entered from a form...
to be more precise; I have a div block - within that div is a header and paragraph. I want to present the user with a form to fill in both fields, then when they hit submit it will refresh the page and build out the div with their submitted content. (obviously what I intend to build is a bit more complex but this is the basis for it)
I want to limit to html, css, and javascript/jquery if possible.
My javascript skills arent mastery so I'll need to see it in action most likely to fully grasp how to.
I'm working on a project and I need some advice/help on how to build a slideshow using arrays in javascript. What I'm trying to accomplish is having an array of 16 different photos and a button that you can click to display the next image. When the last image is reached it will then start over at the first image. I can put all the photos in the array and I have created the next button but im not sure how to make the function.
View 1 Replies View Relateddoes anyone know how I can build a regular expression e.g. for the
string.search() function on runtime, depending on the content of
variables? Should be something like this:
var strkey = "something";
var str = "Somethin like this";
if( str.search( / + strkey + / ) > -1 )
{
...
}
I declare multiple variables halfway down the page. The number between "mech" and "Num" is generated dynamically in the XSL. Later on I need to reference that variable in a function, but I need to build the variable name in script. How do I convert it from a string reference to a ref to the global variable?
function changePreference(pos,mt){
//mt does not reference mech2Num, I need it to.
}
changePreference(2,'my' + pos + 'Num');
var mech1Num=1|2|3|4|5|6;
var mech2Num=1|2|3|4|5|6;
var mech3Num=1|2|3|4|5|6;
I have written an ASP.net app that pulls settings from a
database. Part of the setting definition is a regular expression that
I want to use on the client via JavaScript for data validation...
1) Sample code for the setting object:
----------------------------------------------------
function setting(id, name, validationPattern, validationMsg) {
this.id = id;
this.name = name;
this.validationPattern = validationPattern;
this.validationMsg = validationMsg;
}
2) Sample code on the page that creates a new setting object:
----------------------------------------------------
setting(1, 'test', '^d{1,1}$|^d{2,2}$|^100$', 'invalid value');
3) The issue:
----------------------------------------------------
The setting object gets built just fine except the pattern argument
gets escaped by javascript!!!
^d{1,1}$|^d{2,2}$|^100$
GETS ESCAPED TO
^d{1,1}$|^d{2,2}$|^100$ (Notice how the double is now a single )
Is there any way for me to preserve the pattern text as is?
I am just starting to use the DOM to do some more advanced
javascripting so please be patient with my question if it is an
ignorant question.
I would like to use the DOM to dynamically create an html table via
javascript. While that table is being dynamically created in a
javascript function I would like to dynamically insert text and a
hyperlink with an image into each cell.
I got pretty far on my own. I was able to dynamically create a table
and insert a string into each cell. However, I was not able to use
the DOM to insert a hyperlink into each cell. I tried adding it as a
new text node and got the text of a link rather then a link. I then
tried adding and setting an anchor element but I got nothing. Code:
I'm trying to build a content slider with jQuery Cycle: [URL]
My code is here: [URL]
Basically I'm looking for a content slider with 4 slides, simple fade transition (1st slide fading in would be nice also), and each slide will link to a different page of my site. Basically this: [URL] (but with the addition of linked images...)
I'm having some problems creating a dynamic selector.I'm using the BeautyTips plugin and i can attach a tooltip to a div by using the id of the div, for example:
$('example2').bt({ // attaching to one element by id
contentSelector: "$('#example2-content')" // this will return, as the tooltip's content, what's in example2-content
});
I've got this XML file:
<?xml version="1.0" encoding="utf-8"?>
<Menu>
<Section>
<Title>Product Information</Title>
<Topic url="howto.html">How to use This Product</Topic>
<Topic url="product.html">Product Overview</Topic>
<Topic url="sysreq.html">System Requirements</Topic>
</Section>
.....
</Menu>
There's more data than that but for brevity that's the way it's constructed and repeats with several Titles and Topics. Here's the JS I'm using to build a dynamic menu. The goal is to pick up the data and build an Accordion menu out of it:
if (window.XMLHttpRequest) {
xhttp=new XMLHttpRequest(); //create ajax var
} else {
xhttp=new ActiveXObject("Microsoft.XMLHTTP"); //IE
} xhttp.open("GET","menu.xml",false);
xhttp.send("");
xmlDoc=xhttp.responseXML;
document.write("<div class='acc'>");
var x=xmlDoc.getElementsByTagName("Section");
for (i=0;i<x.length;i++) {
document.write("<dt>");
document.write("<a href='#'>" + x[i].getElementsByTagName("Title")[0].childNodes[0].nodeValue + "</a></dt>");
document.write("<dd><ul>");
var y=xmlDoc.getElementsByTagName("Topic")[0].childNodes[0];
for (foo=0;foo<x.length;foo++){
document.write("<li class='acc_item'><a href='#'>" + x[i].getElementsByTagName("Topic")[0].childNodes[0].nodeValue + "</a></li>");
} document.write("</ul></dd>");
} document.write("</div>");
It creates the menu correctly... to a point. It has the correct styling, the accordion works perfectly, it has the correct Titles in the correct places, but when I "expand" one of the Titles it lists the first topic only, and lists it 5 times (the same amount of Titles I have). It then repeats this for every section. Example:
Product Information
How to Use This Product
How to Use This Product
How to Use This Product
How to Use This Product
How to Use This Product
I'm not very confident in the syntax, or what it is exactly doing.
I have a text input box where users can input values separated by a line break. What I need to do is to take those values and put them all into an array once they hit "submit".
I can do this one line at a time, but I would like to be able to do it all in one hit.
Can it be done in javascript?
I am looking for code samples or websites that show me how to build a table that can split into multiple pages if there are more than certain rows. I am using AJAX to load the data into the table. But if the websites or code samples do not do AJAX, it's fine too because I maybe able to modify it to work with AJAX.
View 3 Replies View RelatedI just came across following demo application: [URL] I have a few questions about this:What is the right approach to start a project, which have heavy use of JS? how to choose which library is best, or one should develop his own library specific to requirements to keep the file size smaller?
View 24 Replies View Related