Complex Script Creation.
Sep 12, 2007
I need help putting together a script that will take all standard text on a page and translate it to another language (spanish or german).
So if I post this script on my blog at any given time (in the comment section) it will change the language for all viewers. Where do I start? Will this work on both FF and IE6/7?
View 4 Replies
ADVERTISEMENT
Jul 23, 2005
I have been handed the task of updating and maintaining a web
application, written in ASP and Javascript, that takes complex
user inputs in HTML form and submits them to server-side ASP
pages for processing. The problem is, the user inputs can
become very complex, and the way this application was developed,
the inputs are all concatenated into monstrously long strings
of text that are then submited as <hidden> inputs in HTML forms
and parsed by the server-side ASP. This results in hideous strings
that go on and on like
johnsmith~1232^01^Yes^no~~|43|april
etc. etc. This code is an incredible pain to maintain and update.
There has got to be a better way to do this. I am required to
use javascript and vbscript in ASP pages on the client side,
and ASP pages for processing data on the server side. I can't
switch to a different technology, or use .NET, or anything like
that. I have to use JS and VBScript to get intricate and lengthy
user inputs and submit them for processing. I would like to
store these inputs in objects somehow and then get the data
from those objects, if possible.
View 11 Replies
View Related
Jul 23, 2005
My web page has one unordered list that disappears in Firefox. The
unordered list in question has the class="dir". I double-checked the
source code and verified the markup's semantics. Everything looked
fine. So I placed the code in the W3C validator and it passed with no
errors. Then I placed a regular unordered list with no class before
the previous unordered list. Upon a reload, the new unordered list did
not render, yet the unordered list with the "dir" class appeared. The
whole situation was strange.
After reviewing web page with the DOM inspector, the disappearing list
had been assigned {display: none}. Apparently, my JavaScript for
TreeMenu functionality was the culprit. I attempted to debug the
JavaScript. Sadly, my JavaScript knowledge is elementary even though I
successfully implemented the approach from
http://www.bakketun.net/listmenu/. When my web page became more
convoluted, the JavaScript began faltering along its seams.
Here are my discoveries while debugging (using Venkman). The
elementHasClass() should match the "element.ClassName" with
"TreeMenu." If not, the function return false. Unfortunately, another
function passes the div element to the setMenu(); then the said
function assign the display attribute; block or none.
But I can not pinpoint where the code goes down the wrong path;
needless to say develop a solution.
Please review the site below and let me know if you have suggestions.
View source and search for class="dir"; the disappearing list has the
text "test." Problematic code JavaScript area may include the line
listed below. This posting was intended as a short description.
Further clarification will be gladly provided if someone shows
interest in a particular aspect. I have pages of notes on the
debugging process.....
View 1 Replies
View Related
Jul 20, 2005
I am trying to implement JavaScript that will remove a table row in frame [left],
and append it to a table in frame [right]. The browser is IE6.
I've played with several approaches for quite a bit of time, but none of them seem
to work. The removed row does not seem to be able to go across the frame boundaries.
Here is the code in the target frame [right] that is invoked by a button in
frame [left]: Code:
View 1 Replies
View Related
Jan 3, 2012
I have a nested listview in my app which creates table inside table at runtimei need to get value of td from second tables tr where i have row number of first tables tr?
<listview1>
View 6 Replies
View Related
Apr 19, 2006
I'm trying to add a timeout to the mouseout behavior, to keep the menus open for a split second after the user mouses out. (IE 6 only for now).
I'm having trouble using the the setTimeout function with a complex statement. Here's the function:
function mouseOutActions(el) {
//el.className=el.className.replace(new RegExp(" sfhover"), "");
setTimeout(el+"'.className = '"+el+"'.className.replace(new RegExp(' hover\b',''),'');",2000);
}
View 2 Replies
View Related
Sep 23, 2010
To build a menu block which should be switchable with hide/unhide of the menu items, I'm using .append html.
navigat += '<h3 class="infoH3"> <a id="' + menuID +'"'
+ ' href="javascript:slideMenu('' + menuSlider + '');">'
+ menuName + '</a></h3>';
[code]....
At the moment I build those html elements line by line. Also OK .. as far as the resulting string has the opening and closing tag, eg.
"<li>aMenu2</li>".
As can be seen from above posted code there is a line "<div id="' + menuSlider + '" style="display:none">".Appending that -- AFAIS -- the .append is automatically (????) adding "</div>" which closes the statement.That breaks my idea of the whole concept! The menu part isn't included in the 'menuSlider '.How to change it -- NOT to have that "</div" added to it?
View 15 Replies
View Related
Aug 1, 2005
How can I access a DIV item in a given row/column, which itself is a cell of
another table of some other given row/column??? I.e. an element of a table
in a table! I have been trying to use GetElementByID, by Name, etc.. but not having much
success.
View 3 Replies
View Related
Oct 6, 2005
What I'm currently doing is returning a list of images in a directory via a form list. I'm an asp guy so vbscript is the way I'm doing this:
<select name="image" size="10" onChange="generateimage(this.options[this.selectedIndex].value)" align=left>
<%
Dim FSO
Dim Files
Dim File
Dim Count
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
Set Files = FSO.GetFolder(Server.MapPath("./moms_images/")).Files
Set FSO = Nothing
Count = 0
For Each File In Files
Select Case LCase(Right(File.Name, 3))
Case "jpg", "gif", "bmp", "png"
Response.Write "<option value='" & File.Name & "'>" & File.Name & "</option>"
End Select
Next
Set File = Nothing
Set Files = Nothing
%>
</select>
What I *hope* to be able to do is allow a file upload (also vbscript) from a pop-up window and, when the upload is complete, refresh the list (above) without reloading the page (AJAX fever, methinks)
The only thing that would make it even cooler would be to auto-select / display the newest upload otf (I use dhtml to display the images on-select ala dynamicdrives example).
I realize this is a fairly tall order, but would be greatful for any pointers or weblinks for this js-challenged soul to use to get started.
View 2 Replies
View Related
Jul 20, 2005
Does anybody know why IE5+ does *not* honour array objects (like a table)
across a session?
Example:
Frame A contains a var tableVar which is set via form Frame B (on init)
using top.A.tableVar = document.getElementById("someTable");
As long as Frame B is *not* 'refreshed/ reloaded' witk another page the
variable in Frame A is ok.
However, when the page is changed it just 'kills' the rows in tableVar.rows
(the lenght just turns to 0).
When tested with something simple like a String (instead of a table) the
above mechanism works as expected.
After two full days of mucking about this is strting to smell funny.
Does anybody have any idea/ suggestion as to the what and/ or why of this
behaviour.
View 9 Replies
View Related
Oct 20, 2011
I am having trouble getting the selected option in a list of more than 20 items in sharepoint, The code below works for lists of 20 or less but not for lists of greater than 20. If any one has a snipet of code that will enable me to set a variable with the selected value from a complex dropdown it
[Code]...
View 1 Replies
View Related
Jul 23, 2009
Enter a search term and:1) Google Blog Results show up2) Twitter Search Results show up3) Google Maps with custom xml data shows upI have accomplished the first 2 parts - http://www.justincener.com/xmlI now want to add in Google Maps. The idea is to type in a athlete's name and have results come back from Google Blog Search (done), Twitter (done), and Google Maps. I only need to show 2-3 choices, so I want to create a custom Google Maps XML doc that corresponds to a few search terms. For example, when someone types in "Tom Brady", I want a Google Map to also come up along with the Google Blog and Twitter Results.
On the map, I want to plot 4 points showing his 4 next games. I think I know how to create the custom XML for GMaps, but I don't know how to implement it so that when someone enters input, the GMaps will show up. Can anyone get me started in the right direction please?Here is the JS so far that handles Google Blog Results and Twitter Results:
var errorCount=0;
var twitter_link;
function searchGoogle(query)
[code]....
View 16 Replies
View Related
Aug 5, 2009
I am writing an accounting sofware, and I have difficulties with the form used to enter the debit and credit for a given transaction. I have used the Jquery validation plugin demo, but I don't know how to hide a specific input cell and replace it by blanks. In accounting, you have either a credit or a debit. So I have an indicator tick box at the beginning of each line which defines whether the line is a debit or credit, and if so it hides the credit cell or debit cell.
</head>
<body>
<h1 id="banner"><a href="http://bassistance.de/jquery-plugins/jquery-
plugin-validation/">jQuery Validation Plugin</a> Demo</h1>
<div id="main">
[Code].....
View 1 Replies
View Related
Feb 1, 2011
This isn't working. I'm using the code below to try to apply the href attribute of the first td in a row with class DataFormListTDDataGridItem and apply it to all td elements in that row (effectively want to make entire row clickable and direct it to the href specified by the href attribute in the first td of the row) -
Table looks like this -
View 9 Replies
View Related
Apr 1, 2010
I know that it is possible to create map via javascript, which has some spots used like links.
I have 3 images:
background, house and man.
Also 3 php variables:
$man = 'yes';
$background = 'yes';
$house = 'no';
What I need is to make javascript map which would show background(yes) and man (yes). House must be invisible, because I have NO.
The problem, that man must appear to 21px width 100px height and be active as a link.
If you haven't understood what I want - ask.
Now I will try to explain this with example.
You have a map with countries. But map is like image and you can't do anything. If variable with country gets value "yes" - the country become active on the map and you can push on it.
View 7 Replies
View Related
Jan 10, 2005
How do you create dynamic element such as ifram, div, table , etc.... With the X library
View 1 Replies
View Related
Dec 1, 2005
I'm building a DIV dynamically and putting a P into it like so:
var oDiv = document.createElement("DIV");
var oP = document.createElement("P");
oP.style.backgroundColor = "green";
oP.appendChild( document.createTextNode("some sample text") );
oDiv.appendChild(oP);
oDiv.style.position = "absolute";
oDiv.style.left = "100px";
oDiv.style.top = "100px";
oDiv.style.width = "200px";
oDiv.style.height = "150px";
oDiv.style.backgroundColor = "blue";
document.body.appendChild(oDiv);
The problem is that FF doesn't put the P in the top left corner of the
DIV. Rather it seem to push it down by a line height. Is there some
white space sneaking into the DIV? How do I get the P right into the top
left corner?
View 5 Replies
View Related
Jun 2, 2006
can anybody tell me how you can create a new stylesheet inside a
(X)HTML page with JavaScript and Firefox, if the stylesheet is only
available as a variable value, like:
var CSSStyle = "rect {fill: lightgrey;}
circle {fill: red;}
polyline {fill: none; stroke: red; stroke-width: 0.3;}
text {font-size: 2.5px;}
text.text-x-axis {text-anchor: middle;}
text.text-y-axis {text-anchor: end;}"
So far, the only workaround I found, was to link an empty stylesheet to
the page
<link rel="stylesheet" type="text/css" href="./empty.css"/>
and then use the insertRule method on this stylesheet for every single
rule from the variable (indexOf('}') / substring()).
View 3 Replies
View Related
Jun 30, 2009
I'm working on a script for Hulu that will present the user with some options, then automatically sort their queue depending on those options (a blessing for someone like me with 450+ entries). The sequence is as such:Read and store all entry rowsPresent user with a form to assign shows to categoriesPresent user with a form to assign weights to categories (so something can show up more or less often in a "block") as well as options for how to sort entriesSort previous row listings based on user inputDecide the order of shows and change the values of their respective "Order" boxesI've gotten it to work up until this last part. I'm creating the dialogue boxes using proper DOM input (at least, I believe so), but for some reason I can't use getElementById() or getElementsByName(). I can use getElementsByClassName() and getElementsByTagName(). When trying to use the first two, I'm just told that it isn't a function.
Here's the code section itself, the problem line is Line 3:
Javascript Code:
This is inside an onclick event; finalBox is declared outside of that handler. I'm able to use finalBox.getElementsByClassName in the same function about 20 lines up. For reference, here's where I create the elements I'm trying to find:
Javascript Code:
CustRow is a function that helps me shorten the code of adding a cell to a row (with addCell()); it creates a row element and attaches it to the given table element.
That first piece of code is the only place where I use getElementById. My main thought is that I'm doing the ID wrong and, for some reason, it's not registering with the DOM (though that doesn't explain why getElementById() still fails instead of returning null/undefined). Also, while I hope to eventually make this a FireFox add-on, I'm executing all of this through the FireBug console, so I don't know if that would affect it or not.
Any insights? I can change it to use getElementsByClassName (and it appears to work), but this is really frustrating me and I'd prefer not to use a messy work-around. (Actually, getElementsByName would be best, but I thought that getElementById would at least work.)
View 2 Replies
View Related
Dec 28, 2011
i am working on java script and what exactly looking for is. whenever i select other in drop-down menu a text box should be displayed and whatever text entered in other text box should be saved in database when i submit the form. in addition to this in my script i have got two dropdown menus and both have other option in them.so i want a function which can be used to add other option to my both dropdown menus.
View 4 Replies
View Related
Feb 21, 2005
I am using this syntax to create an object:
Code:
carObject = {
model : "Volvo",
color : "blue",
outputModel : function()
{
alert("Modelname is: " + this.model)
}
};
carObject.outputModel(); // alerts "Modelname is Volvo"
Lets say i would like to add a new property, called brand, thats is equal to model. Can anyone please explain why this doesnt work?
Code:
carObject = {
model : "Volvo",
color : "blue",
brand : this.model,
outputModel : function()
{
alert("Modelname is: " + this.brand)
}
};
carObject.outputModel(); // alerts "Modelname is undefined"
View 4 Replies
View Related
Oct 22, 2007
I have reason to want to be able to change a Firefox stylesheet rule dynamically. I have found, doing google searches, sites which tell you how to create stylesheets dynamically or just add and delete rules, but none of these pages procedures have worked in my Firefox. Some have worked in Internet Explorer. Most have claimed to be cross browser. An example of one which I had high hopes would work can be found at this link.. The code they give you near the bottom of that page is posted below with the original background color changed to red and some text to see the background color put in the body of the page. In other words I pretty much just pasted the code found their in the head portion of my HTML page.
Attempting to troubleshoot why this code is not working if I use the old alert message method and put an alert message between the lines "var mysheet=document.styleSheets[0]" and the line "var totalrules=mysheet.cssRules? mysheet.cssRules.length : mysheet.rules.length" the mysheet variable region out as being "object CSSStyleSheet", however if I use the newer step through method with firebug it reads undefined. So I am totally baffled. Code:
View 2 Replies
View Related
Mar 11, 2010
I created the checkbox using this code:-
var chkbox = document.createElement('input');
chkbox.type = 'checkbox';
chkbox.name = 'disrow';
Now when i tried alert(document.forms['actionsForm'].disrow) I am getting undefined.
View 2 Replies
View Related
Mar 7, 2011
I'm creating some links with PHP and here is the code for that:
Code:
<br><a id="add_to_cart" href="add_to_cart.php?pic_id=<?php echo $resultsetnewpic['pic_id']; ?>" class="under_pic_cart">Add to Shopping Cart</a>
There is a while loop to keep adding them but wanted to keep it simple. So right now there are three links that get created. I'm trying to find out the value of these links so I can add things to a shopping cart for the user. I have the following jquery to do this:
Code:
$(function() {
$(".under_pic_cart").click(function(){
alert("it gets here");
[Code]....
This part works fine. However how can I get the href value of this and then once I have it basically split it after the = sign to get the value I'm really looking for?
View 1 Replies
View Related
May 7, 2011
I am getting a string with the value of the clicked button from an array and some other select field values that are listed in the same set of mysql results as the clicked button.At the end of the script the page is redirected to in the script mentioned page with following string:process.php?value=1&bs=2&ad=3&ns=4&wt=5&in=6
Is it possible to make locationstring variable global and in a single line in order to be able to use the full string in other scripts or is there another solution.
View 1 Replies
View Related
Jul 23, 2005
im currently working on a web app which uses heavy javascript. in one
of the functions, a simple array is created using "var admin_types =
new Array();". This array is not empty, it has a length of 0 but
contains one element with the name "clone" and the value
function () { var copy = {}; for (var i in this) { var value = this[i];
try { if (value != null && typeof (value) == "object" && value !=
window && !value.nodeType) { value.clone = Object.clone; copy[i] =
value.clone(); } else { copy[i] = value; } } catch (e) { copy[i] =
value; } } return copy; }
why does this element get created?? The weird thing is that i use a lot
of arrays and this is the only one that has that element.
i tried this in firefox 1.0, ie 5.5 and mozilla 1.7.1 and the element
is in the array for all of them...
View 10 Replies
View Related