Pulling Href From Element?
Jun 4, 2009
I have a dropdown menu that is structured by AJAX but some of the options have href values within i.e.
<option>Blank anchor - (Increase size - anchor title) text.php?size=1&pg=index.php</option>
when the second part of the AJAX code is sent using this to retrieve the info:
var tester = document.getElementById('test').value;
var queryString = "?tester=" + tester;
it retrieves as
<option>Blank anchor - (Increase size - anchor title) text.php?size=1</option>
View 2 Replies
ADVERTISEMENT
Feb 4, 2011
I use mostly PHP with my office's website as it usually requires some interaction with the server. However, i would like to do something that does not,and figured JS should be able to take care of it.What i would like to do seems rather simple:I have a calendar. I would it to do one of two things:
1. Using onclick, when the user clicks on a date, i would like it to print something underneath the calendar. Similar to an error message that shows up on a login form if you type something wrong in a field using PHP (if(isset($whatever))).
2. Or using onMouseover, if the user hovers over a date that i have something special scheduled, i want a message to either pop up (alert()) or similar to #1, show up below the calendar.
While fiddling with it this afternoon i figured i was close, but i am missing something...
<td><a href="#" onclick="document.getElementById("27").innerHTML='President's Day'; return false;">27</a></td>
But this seems to be pulling information from an element whose id = 27...which is not what i'd like..
View 4 Replies
View Related
Aug 7, 2009
I'm trying to add a class to a <li> where the href within it contains a string. I can apply the class to the anchor without a problem, but I can't seem to select the parent. Is an anchor a child? <li><a href="random.xls">Random Stuff</a></li>
In this case, since the href contains .xls, I'd like to be able to add a class to it. I've tried a variety of things, most recently this, but no luck: $('li has(a[href$=".xls"])').addClass('excel');
View 1 Replies
View Related
Mar 24, 2009
Does anybody know what's happening here? It's driving me nuts.
<a id="prevLink" href="#" alt="prev">previous</a>
getElementbyId("prevLink") returns the href value, but I need to work with the A element itself.
View 8 Replies
View Related
Jul 21, 2010
The code below ADDS a new EMAIL field to the form via an href link. here modify the code to REMOVE an EMAIL field? or point me in the right direction?
[Code]..
View 1 Replies
View Related
Oct 27, 2011
How do I get href links from classes & append/prepend them to some element. My attempts...& many other I can't mention
[URL]
View 12 Replies
View Related
Jul 12, 2010
I'm using the following code (simplified version) to call a Json file, parse it and on each iteration, create a div with an ID of "tab". I'm using this with jQuery UI .tab() to create a listing with entries which have three tabs. Anyhow, the principle seems to work except that when I examine what's happening behind the scenes using Firefox console, I see that each href in the html code produced is causing the Json function to re-fire using the href as it's url target.
<!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" xml:lang="en" lang="en">
<head>
[Code].....
View 6 Replies
View Related
Jul 23, 2005
In the head I have:
<link type="text/css" rel="stylesheet" href="myfirst.css">
<script src="myfirst.js" type="text/javascript"></script>
I have the following in 'myfirst.js' file:
var writastring ="<table width="250" border="2"><tr>
<td>Here is my first script text</td></tr></table>"
I have the following in the myfirst.css:
#ontheleft{position:absolute; left:10px; top:50px; }
In the body of the HTML file directly below the body tag is this:
<div id="ontheleft">
<script language="javascript">
document.write(writastring)
</script>
</div>
My problem is that it writes.......Fanfare........exactly nothing.. nada.
And yes they are all in the same path. Even if I change to this: var writastring="OK! Write this" nothing is written. Even leaving out the Div tags nothing changes.
The purpose of this exercise is to assemble content in the
JS file and then write it in any number of pages.
View 6 Replies
View Related
Nov 7, 2010
I have this software that returns an array like this:
[{"Id":148,"Text":"excellent","Percentage":18},{"Id":166,"Text":"good","Percentage":25},{"Id":167,"Te xt":"fair","Percentage":30},{"Id":168,"Text":"poor","Percentage":25}]
How can I go about turning it into an array that looks like this (just the last integers)?
[18,25,30,25]
View 3 Replies
View Related
Jun 24, 2011
I'm working on a html5/javascript app for android using phonegap. [URL]
My app is going to display the daily item from say [URL]
I want be able to have the new image of the item display once it has changed.
here is site that does something similar in a sense. [URL]
what would be best way to do this in JS and/or Jquery
View 1 Replies
View Related
Apr 27, 2011
I've created a jquery slideshow what I wanna do is to pull files from a directory and add them to the slideshow like open file dialog or any other technique.
View 12 Replies
View Related
Feb 20, 2010
Code:
<html>
<head>
<script type="text/javascript">
[code]...
how to call the values at random in the arrays: article, noun, verb, preposition ?
View 1 Replies
View Related
Jun 11, 2009
I know that Picasa does give the facility of exporting images as a slideshow, but their version contains user controls which we don't want and it is also in Flash - our IT dept don't really support Flash!
Anyway, the slideshow I would like to use and the image gallery display using Picasa images that I have already done can be seen on this test page [URL].
The gallery pulls the images from Picasa using the API in the page body:
<script src="http://picasaweb.google.com/data/feed/api/user/cycletheyorkshiredales/album/CycletheDales1?authkey=Gv1sRgCKuzudmF-bC5aA&kind=photo&alt=json-in-script&callback=output&access=all">
</script>
[Code].....
- so that the slideshow can be called using the images from the array called fadeimages.
View 2 Replies
View Related
Mar 2, 2010
I am creating a template generator page that generates a webpage based on what I fill in for certain elements like image name, img src, book title, book author, etc. and these values are sent to me in an excel document which right now I just open and copy and paste everything from the excel document into the form fields for each section.So for example the client sends over a list of book titles they want featured on the page this week and they include author name, author link, book name, book url, img src, etc. and I just copy those new fields into my template and then click generate and the updated HTML code is there for me to copy.
This part works totally fine but in the interest of saving time copying upwards of 100 fields from an Excel file into my template, is there a way I can select the excel file (stored locally) on my page with a "browse" directory form and then have a button that runs SQL queries on my Excel document to pull these updated titles, images, etc into my form fields dynamically?Do I need to utilize server technology for this or is there a simple script that when I click a button, will look at whatever excel file I have selected and say "grab this row at this column"?What is the best way to do this?'m relatively a noob when it comes to this stuff but I do know javavscript and SQL pretty well.
View 3 Replies
View Related
Jun 26, 2010
I am trying to set up a web based tool for my wife and I to use to balance our checkbook together. I am using HTML, Javascript (Ajax), PHP and MYSQL. I have read beginner books on all of these subjects, I can get data out of MYSQL, BUT can't do it the way I want to do it. If someone could point me to a book, or even the name of what I need to study it would be very helpful. The top line will always be input. But as you submit the top line it refreshes the "growing list" beneath it. (kind of like on-line banking, where you can look at 50 or so lines and then go back further if necessary) The catch is within the "growing list" I want to show Bank and book balance running totals and have three buttons next to each transaction ... EDIT DELETE SUBMIT. If edit is clicked, I want to be able to change that line and then resubmit it to MYSQL.
[Code]...
This way we can both input our transactions as we spend money and know at all times how much money is in the account. What do I need to study to be able to program this?
View 4 Replies
View Related
Mar 18, 2010
lets say I have
Code:
alpha.numeric.1.array
alpha.numeric.2.array
alpha.numeric.3.array
how would i go about getting the data in the array? my current thinking is
HTML Code:
for(index=0;index<=3;index++;)
{
alpha.numeric[index].arraykey;
}
View 5 Replies
View Related
Jul 21, 2005
I have a form input field and a link right beside it...
The input field is a text based field it will contain a name from a list of current names... the link is a search button which brings up a smaller window if the user does not know a name... this way they can search in the smaller window using a dropdown menu otherwise just type the name into the form... my windows and stuff pop up fine but i can't figure out how to make the value of the input field equal that of the selected information in the pop-up windows form field when it closes...
View 3 Replies
View Related
Jan 9, 2010
I have the following code:
Code:
<SCRIPT LANGUAGE="JavaScript" TYPE="TEXT/JAVASCRIPT">
<!--
function post45 ()
[Code]....
I am trying to get the value entered into the firstname box appear on an alert box when the send button is pressed.
With the above code the alert box dosnt display but if i take away the + myForm.firstname.value + from the java script it displays the alert box.
View 2 Replies
View Related
Jan 9, 2010
I have the following code:
Code:
I am trying to get the value entered into the firstname box appear on an alert box when the send button is pressed.
With the above code the alert box dosnt display but if i take away the + myForm.firstname.value + from the java script it displays the alert box.
Way i can get the + myForm.firstname.value + to display the entered value ?
View 2 Replies
View Related
Oct 22, 2009
I have a form with 3 <select> items in it.Each one is to allow only 1 item to be selectedThese are the variables for mySQL query through PHP. I have a js file that is called when one of the select elements changes.I want the .js file to pull the value of all 3 of the select elements even if its blank.I can handle the error checking in php, i just don't know JS.This is simple html for the select item(s) each is named different but similar syntax.
Code:
<form name="viewData" class="shifty" >
<label>Select a month for Points Awards:</label>
[code]....
View 1 Replies
View Related
Jan 30, 2010
I should warn, i know almost nothing about javascript. i've been trying read sample scripts and examples on how to modify this script; but I just don't know enough. I have a script that pulls data from an array, and copies it directly to the clipboard when a user clicks on it. The problem is this only works in IE, because Firefox doesn't by default allow that to happen. I'm trying to change it so that when it is clicked, instead, it takes what was going to be copied to the clipboard, and puts it in a Prompt box for the user to copy and paste. I had other scripts that do that, but I can't for the life of me figure out how to learn from it!
[Code]...
View 7 Replies
View Related
Aug 18, 2011
Anyone know if there is a way to get the title string from an iframe src coming from another domain?
View 6 Replies
View Related
May 20, 2010
I am trying to create a page that will pull data out of an input text box to a variable. I am then trying to take that data and punch it into a function, to eventually spit out the answer back on the web page. It has to do with telling the user to enter how many hours worked and their pay rate. I have included the code below. The problem I seem to be having is that I want to click a button to pull the data, then output the result in another script below the input boxes. I may have over done it with the functions, but what can I say..I'm lost! When I try to run it, I have the document.write cmd in there that is supposed to output the variable grossPay. Instead, it shows all the code instead of the value.
If I have something else wrong, or if I am making poor choices let me know. For some background, so far I am in the beginning stages of functions, if..else statements, so I am not trying to get crazy with this. Just something simple.
[Code]....
View 4 Replies
View Related
Jan 1, 2011
How can I set a href or onclick function for an "a" element that passes information to the function?I have a function showpage() that is called whenever one of a number of buttons are clicked. I need to pass information from the button clicked to that function.
View 4 Replies
View Related
Aug 22, 2011
[url]
The code:
When I go to the site using FF5 or Safari 5, everything pulls up great. When I try to open the page using FF3.6 or IE8 none of the classes show up, I then up Firebug or IE Developer toolbar and refresh and the xml appears without failing.
View 2 Replies
View Related
Jul 31, 2009
How do I retrieve the currently selected option string in a select box instead of the value?
<select id="choices">
<option value="value">String</option>
</select>
Using
$("#choices").val();
returns the value if it's set. if there is no value set, jQuery returns the string instead. I want to retrieve the string while a value is set!
View 1 Replies
View Related