Walking DOM Query
Nov 28, 2006
I have a ul I want to access via the DOM that is here:
<div id="options>
<form>
<div>
<div>
<span>Some text</span>
<ul>
...
</ul>
</div>
</div>
</form>
</div>
Each child of #options has text nodes besides the HTML elements. Short of doing
document.getElementById('options').childNodes[1].childNodes[1].childNodes[1].childNodes[3]
or giving the UL an ID, is there any other way I could access that UL? I'm imagining something like an array containing every single child (even grandchildren, etc.) of #options but I don't know if it exists. I know the most sensible thing to do is to give the UL an ID, but I'm curious.
View 3 Replies
ADVERTISEMENT
Dec 20, 2006
I'm working on a little javascriptlet/greasemonkey script, and I've run
into a challenge that I think can be solved with walking the DOM, but I
feel like I'm kludging my way through and wondering if there might be a
better answer out there.
Here's the problem: I want to insertCell(0) into an existing table, but
the table doesn't have a NAME or ID. I don't have the option of adding
these (it's for Wikipedia) and would like to programatically navigate
my way to the table. The table is inside a FORM element that _does_
have an ID, so it's pretty close to a known entry point. I was
originally planning on using .firstChild a few times in a nested
sequence to work my way down to the table, but it's proving trickier
than I thought it would, hence my question here. Code:
View 8 Replies
View Related
Jul 23, 2005
I was wondering if you can get the info from the query string in a server-side javascript tag?
Here's what I'm trying to do...
View 8 Replies
View Related
Nov 13, 2007
I need a script that will get a query string and return it's value.
View 1 Replies
View Related
Aug 20, 2003
I have a page of rows of dynamic data... the user can click on a link for each entry... that allows them to open a popup window... add / edit or delete some sub-entries for each entry.
When they close the popup window, how can I get the background page to refresh and show the updated data... without pressing the refresh button...
a) could I get the page to refresh automatically every 30 seconds ?
b) could I get the popup to switch focus to the window that opened the popup and then refresh that page?
View 1 Replies
View Related
Mar 24, 2005
i have javascript menu form my site that has two js file:
"data1.js"
PHP Code:
var isHorizontal=0;
var blankImage="images/blank.gif";
var fontStyle="normal 8pt Verdana";
var fontColor=["#000000","#000000"];
var fontDecoration=["none","none"];
etc....
var menuItems =
[
["Page 1","page1.php","img/new1-05.gif","img/new1-05.gif","Page1"],
["Page 2","page2.php","img/new1-05.gif","img/new1-05.gif","Page2"],
etc...
];
// Do not remove this line!
apy_init();
and "apymenu.js"
I want to link "page1.php" pick up id from url (http://www.mysite.com/anypagewithid.php?id=34) and when i click at menu it has to be url page.php?id=<id_from_url>
I have try menu at site, it works fine ;-)
Also, how can include some php in menu, like list of mysql rows and etc.
View 9 Replies
View Related
Jun 21, 2006
I have created an array and store 3 functions in it. Eg.
this.validateCols = new Array();
this.validateCols[this.COST] = function(obj, index)
{
return 0;
};
this.validateCols[this.LOCKED] = function(obj, index)
{
return 0;
};
this.validateCols[this.COMPLETION] = function(obj, index)
{
return 0;
};
Calling validateCols[0](0, 0) works in IE, but in Firefox I get:
validateCols[0] is not a function
Is this the correct way to define functions in an array? Or is there a better way?
Or is this not supported at all in Firefox?
Q(2)
Also .swapNode() is not in Firefox? Any alternatives?
Q(3)
I implemented drag 'n' drop and it works in IE but not in Firefox.
Each droppable HTML TD element has:
ondragenter="this.parentNode.style.backgroundColor = 'gray' window.event.returnValue = false;"
ondragover="window.event.returnValue = false;"
ondragleave="this.parentNode.style.backgroundColor = 'white' window.event.returnValue = false;"
ondrop="OnDrop(this);"
Each draggable URL element has attributes:
id='draggable'
onmousemove='window.event.srcElement.dragDrop();'
ondragstart='window.event.dataTransfer.setData("text", "data");'
View 4 Replies
View Related
Jul 23, 2005
I need to look at the url, if a variable is present in the query string.
so, if my address bar looks like:
View 10 Replies
View Related
Jul 23, 2005
Below is a stock script I found which controls a framed environment.
My problem is that if a URL has a query string attached, that string
does not pass through. Can someone please let me know if and
hopefully how, it will be possible to carry a query string through?
This first part here is in the default.asp framed page. Code:
View 4 Replies
View Related
Jul 23, 2005
i want to pass XML data in querystring from one to another asp page.
it is about 10000 characters long, i cannot use FORM because it is
already nested in one.
What i do is i have IFRAME and im passing some xml data
in QUERYSTRING. It doesnt work somehow, im using javascript escape
method to substitute escape characters, but most of characters are
being truncated (about 300-500 left).
Are there limits in querystring length?
what else should i try?
View 3 Replies
View Related
Jul 23, 2005
Just wrote a basic java script to show a phrase on the client's browser
status bar as follows:
window.status = "Hello World";
It worked properly under IE but not under Mozilla FireFox. The latter
is still showing "Done" when I open the webpage.
View 2 Replies
View Related
Dec 12, 2005
Is there a way to prevent query string showing in the address bar with
out using hidden fields with javascript?
View 2 Replies
View Related
Jul 20, 2005
It is well-documented that if on a page there are several radio-
buttons with the same name these are addressed as an array (and act
collectively).
Someone (LRN?) recently wrote about another case where name-match
implies array addressing.
It therefore occurred to me to try the following crude Web page:.
View 17 Replies
View Related
Oct 29, 2010
I am working on the HTML Code in which i write the 2 pages for SMS Sender & SMS Receiver in that from the SMS Sender when the user sends the SMS it lands on server URL as:[URL]The query is regarding the how to parse the content from the incoming Messgae & the content are shown on the Receiver side. by parsing the Sender Number & the message content from the URL & Receiver side URL is:[URL]how to write the Function for parsing the URL & seperating the SMS Sender & Message content
View 14 Replies
View Related
Nov 13, 2006
I have a table that is generated dynamically using CF. I also have a function that is able to highlight the selected row, but what I don't understand is how this function knows which row it is at. What I would like to be able to do is, click on the selected row, get the hidden value of that selected row, then pass that value to a CF action page using the a href.location.
Right now I hard coded the getRow function to point to a value, but ideally, I want that value to be generated dynamically. Code:
View 13 Replies
View Related
Aug 21, 2007
I have this code which works well, but rather than buttons (title 1, title 2), I want to achieve the same description change using a jump menu. I'm pulling my hair out trying to work it out and i'm sure it's simple. Code:
View 3 Replies
View Related
Dec 24, 2010
I want to map a field, city, from a MySQL database into Google Maps. I found a nice script to do it, but haven't been able to get it to work.
If I hard code an array into locations (var locations = ['Seattle', 'New York']), it works fine. Passing this SQL array into JS is giving me problems.
I've tried a number of different things, but I'm stuck. Right now I'm trying getElementById, but no dice.
<?php
$server_name="localhost";
$db_user="sql_user";
$db_pass="password";
[Code].....
View 4 Replies
View Related
Apr 21, 2010
Ok, I need to have a page where you hit an attack button and it displays your hitpoints after the battle, The problem is that I cannot get ajax to work with a php file if I query the database for the hitpoints.
here is the php [code]...
View 1 Replies
View Related
Mar 19, 2011
Is it possible to connect to a MySQL database from within a jQuery script, run a query, and return the results?
View 24 Replies
View Related
Dec 27, 2004
i'm having the user input their state (from a drop down list) and type in a zipcode (there are 1,143 zip codes in the database to match to)..
what i want to happen is once the user selects the state they live in, and type in a zip code, i need the page to query the database if the user selected Ohio, and match the counties in the database with the zip code they entered, and then create a drop down list of the counties for them to select the one they live in Code:
View 1 Replies
View Related
Jul 14, 2005
I'm laying out a new data entry page and I have it looking as I want it now...finally!
On this page, I have a standard HTML drop-down box which can contain anything from 1 to 100 options (populated dynamically from a DB). It will ALWAYS have a "New Entry" option at the bottom of the list - this is hard coded.
What I want to do is make it so that when someone selects the "New Entry" option at the base of the list, a named DIV becomes visible, so that they can enter the new data. When they select anything OTHER than the "New Entry" option, the named DIV should disappear again.
I'm not that worried about the design of the page shifting when the DIV is made viewable or hidden, so that's not to worry about.
I have no clue with JS or DHTML, so I'm asking the kind folks here to give me a push in the right direction (not off a cliff...thanks anyway) -
View 5 Replies
View Related
Feb 27, 2007
I would like to create a form which allows users to enter a search string, and for the search string to be appended on to the end of this URL:
http://www.oracle.com/pls/db92/print...h_string=BUYER
Where 'BUYER' in the example above would be replaced by whatever they type in the search form.
Of course, if I had the URL of the search form, I could hack that up. But all I have is the URL above - I can't actually find the search form.
This is what I would like to do:
1. User enters search string (e.g. APPROVE)
2. User submits form
3. Form takes this URL "http://www.oracle.com/pls/db92/print_hit_summary?search_string" and appends the value from the form onto the end of the URL
I could do this easily if I had access to a server-side scripting language, but since I don't, I wanted to see if I could do this using JavaScript.
View 4 Replies
View Related
Aug 6, 2002
I have a dropdown menu thats pull value from MySQL. Now i want to query the selected value from dd menu so then it will display a list that match with it in database without submit the page. Do i have to use onChange function and how?
View 9 Replies
View Related
Sep 18, 2010
I want to have a page that is a list of auction items, and for each list item, show a field with the current bid price - easy to do statically, but I want the current bid price field to by dynamically updated by javascript every few seconds from a php database query.I have had no trouble building this page, but what happens is that the javascript will do the php query only once and fill the current bid price field continually with the same value, even if it has been changed in the database.I have the javascript function repeating every second, so that is not the issue.My php script works nicely, so that is not the issue.Just to re-iterate, there is no problem passing a value to javascript from a php sql query, it is in trying to get javascript to refresh the value it gets from the php sql query everytime that it runs.I have been working on this for over a year, and have done loads and loads of research, but to no avail.
View 3 Replies
View Related
Jul 5, 2011
having trouble getting a query string/URL to append a couple of variables from a function (well, trying to get ONE working). Basically, once a user makes a selection from a form, I want the script to add the variable to the query string, which is then sent off to a PHP script. If I manually enter the 'social_housing_type' as a number in the query string, it executes properly, I just can't get it to do it from the form.
[Code]...
View 6 Replies
View Related
Jul 23, 2005
What I am attempting to do is have a link/button on a page
(testpopup.cfm) that opens a popup page (popupwindow.cfm). The popup
page displays a resultset from a query and the selected record needs
to be passed through a query string/URL parameter to the original
calling page and will be available in the body onload event of the
calling page.
I open the popup window and display the query results, I then click on
a record and the record is then displayed in the calling form textbox
(txtOrg) - - - only the calling form appears in the POPUP window!
This is not what I need it to do. I need it to pass the URL parameter
to the calling page and close the popup. Here is the code from the
two pages. Can you shed any light on this? ....
View 1 Replies
View Related