Adding A Variable To A URL?

Mar 31, 2011

I am adding a feedburner url into an html page, but need to make it so you can increase the amount of posts you want to see. Ex. The default amount of posts on the page starts at three, but then I would have a button called more where you would click it to view say 3 more, and then if you clicked it again 3 more, ect.This button would have to call a javascript function correct?

<script type="text/javascript">
var i=3;
function more()

[code]...

The nItems declares how many posts are on the page, so I would want it to equal a variable that can be changed via the button. Also if someone knows how to add ajax so you don't have to refresh the page, that would be a nice extra.

View 4 Replies


ADVERTISEMENT

Adding A Variable To A URL

Jul 24, 2007

I have been working on a script to integrate into my firefox addon that i'm working on. I'm trying to utilize nwtools website which has a lot of network tools whois/trace/dns lookup etc..

I'm currently working on the whois portion. As you can see below, I am trying to make a function that will pass a variable to the ending of the URL. In this case it would be cnn.com.

View 4 Replies View Related

JQuery :: Adding A Variable

Sep 8, 2011

This is a bit longwinded, bear with me, I'm thinking it through. Here's the html structure:

<p class="a1">this text</p>
<p class="b1">that text</p>
<p class="a2">this text</p>
<p class="b2">that text</p>
<p class="a3">this text</p>
<p class="b3">that text</p>...and more like these.

the objective: if the p class name starts with "a", append <span class="add"> A</span> if it starts with "b", append <span class="add"> B</span>

[Code]....

View 6 Replies View Related

JQuery :: Adding Variable To Selector Id?

Dec 10, 2010

Basically I have a carousel, and when an item is hovered on, it's corresponding titles needs to show up below. I've managed to get a very inefficient version this working by repeating the function with the explicit id for the list item, but I'd like to get this working in a more automated fashion by assigning a variable that can be used with both the list item id and the paragraph id. I'm not sure if index() is the best way to go about this, or how to actually add the variable to the id's.

The HTML --
<div id="carousel_holder">
<ul id="carousel">

[code]....

View 1 Replies View Related

Adding IF Statement To Variable Message?

Oct 22, 2010

I have been assigned the old Pizza Form tutorial. My form asks for customer info, select size with radio button, and select toppings with checkboxes.I created a ValidateForm() function to check if these are filled in and output a message for each field saying "please fill in field."My problem now is that on Submit I need to print out a message with customer info, selected size, and selected toppings.I have the customer info done with a var message:

var message = "Name: " + name + "
";
message += "Address: " + address + "

[code]...

View 3 Replies View Related

Adding A Variable To Url When Page Loads -only Once!

Mar 8, 2006

This is for an ASP submission form. User creates a record, Access assigns a unique ID by Autonumber, I want to then pull that ID and insert into URL.

This is my code:

var addID
addID = '<%=(rsResults.Fields.Item("ID").Value)%>'

location.href=('?ID='+addID);

It adds the ID to my url fine, but it doesn't stop!
I've tried making a loop by this method:

var addID, looper;
looper=1;
while (looper < 2) {
addID = '<%=(rsTestResults.Fields.Item("ID").Value)%>'
looper=2;
location.href='results.asp?ID='+addID;

}

View 1 Replies View Related

Adding Alert Feature With PHP Variable?

Mar 25, 2010

I am pretty new to javascript, I've made a php game and I am adding the last touches. Ive got. When I press m it goes to your mailbox. Now what I want is the alert feature. Now I have that. I want it to say. You have COUNT new message(s). How do I get my php variable into that javascript.

View 1 Replies View Related

Adding A Variable To A Pre-existing Script

Mar 6, 2005

The script below is configured as an onmouseover & out fad-in url script. It's been configured it so that the fading of links only occurs in areas with the class name "fade". My first and simplest request is that someone has a quick look and changes the code from class name "fade" to class name "descriptions". i would do it myself but the word fade is also used for other variable names within the script (etc) and i'm not 100% sure which names to change and which to leave

The second aspect I need help with may be somewhat more challenging.
The script currently fades the TEXT of the link from one color to another. I need it to fade something else. luckily i think the modifications to the script might not neet to be that extensive. Here's what I need.

Instead of the color of the text fading in & out, i need the color of the boder to fade in & out. Here's an example:
i need the properties of the link to go from
text-decoration:none; border-bottom:1px solid FFFFFF;
to finish at
text-decoration:none; border-bottom:1px solid FFB903;

the only change is the color... so i figure all we need to do is create a color variable and place it in the code, like so:
text-decoration:none; border-bottom: &#391;px solid' + 'color'
and then simply have that color variable increment using the startColor and endColor variables found below Code:

View 16 Replies View Related

JQuery :: Adding Element HTML To Variable?

Jul 11, 2011

I'm trying to create a function which shows a hidden response when a button is clicked on.I also want to add the response to a variable which lists all the users responses.Here is my code now...

$(".yes").click(function () {var feedback = feedback + $(this).html();
$(this).parent().next("p").show("fast"); });
$(".no").click(function () { $(this).parent().next("p").next("p").show("fast"); });
$("#email").click(function () { alert(feedback) });

The bolded line is the part which isn't working.

View 2 Replies View Related

JQuery :: Adding $(this).html To A Variable Not Working?

Jul 12, 2011

$(function() {
window.resizeTo(925,10000);
$('input').removeAttr('checked')

var feedback = "Your Results: ";
$(".yes").click(function () {var feedback = feedback + $(this).html();
$(this).parent().next("p").show("fast"); });
$(".no").click(function () { $(this).parent().next("p").next("p").show("fast"); });

[Code]...

View 3 Replies View Related

JQuery :: Adding A Click Event To A Variable?

Apr 23, 2010

I have a setting where I construct an image reference which I then append somewhere in the DOM, like so for instance:

var one = "<img src = "test.jpg" ";
var two = "/>";
var my_img = one + two;

and then I add it to DOM using after() function. It works fine. However, I also need to add a click event to it. I tried to do this:

my_img.click(function(){
});

and then append it using after(), but it doesn't seem to work. One thing I can think of is append it after a certain ID, then look for it as a child of that ID and add click to it this way. I haven't tried this, but it'll probably work.

View 1 Replies View Related

Button Passwords - Adding Number To Variable

Dec 18, 2009

I want to create a script where when you hit a button it adds a number to a variable and when you click another button it shows you the amount you have so far. Also I am having trouble with the clear() function where it was suppose to clear the variable. When my var is equal to a certain number (not there yet) I want it to goto another page (I can do this on my own).

Here is my code
<html><head>
<title> Buttons</title>
<body style="background-color:#000000">
<center>
<p style="Font-Family:Curlz MT;color: #CC3333;Font-size:40px;">Click the buttons to test my script
</p></center>
<script type="text/javascript">
var x = 0;
blue
function mouseOver() {
document.getElementById("b1").src ="Hi_h.png";
} function mouseOut() { .....
(The button are images so you want be able to see them if you don't download them).

View 5 Replies View Related

Adding An Incrementing Variable To A Script To Create Different Class Names

Feb 12, 2009

Last evening I ran across this script which I think will address a need I have; replacing my radio buttons with images. The one difference I have is that I need to use a different button image for each of the 5 buttons in my group.Unfortunately, the script dose not apply unique classnames within the generated mark-up so if I'm to use this I need to apply some sort of counting variable that increments and use this variable to append the classname with.Around line 52/53 of jquery.checkbox.js is

Code JavaScript:

/* Wrapping all passed elements */
return this.each(function()
{

[code]....

View 2 Replies View Related

Oncheck Adding / Subtracting Not Adding Up?

Mar 4, 2010

I'm having a problem when I uncheck the box it should subtract the amount from the total which it does kind of. It subtracts a number other that one selected. When I put a alert into the function it pops up with the right amount.URL...click on "comps"uncheck the box under the zillow table.it should remove the amount of SqFt under the little table under the map.The only one that I've established is the zillow.[code]

View 1 Replies View Related

Declare A Variable Inside A Function - Returns White Space - Not Variable Value

Aug 17, 2010

I am trying to declare a variable inside a function and use it later on in my code... but it just already returns white space... i.e. not variable value. I am setting it within this function:

function show_video1(){
document.getElementById('video1').style.display="block";
var video1Name = "Education World News (Part 1)";
document.getElementById('video2').style.display="none";
document.getElementById('video3').style.display="none";
document.getElementById('video4').style.display="none";
[Code]...

and trying to call it later on with this: <script type="text/javascript">document.write(video1Name)</script> It might be worth noting that each one of my 11 videos will hace a different name.

View 13 Replies View Related

JQuery :: Specifying Variable In Parent To Match Variable In Ajax File

Oct 21, 2011

Ok, so I've built a member search using ajax to change the results each time a filter is changed. It works great, except one minor issue that I'm struggling with...I just can't specify dynamically in the parent file that linkclass$id opens linkclasscontent$id as I don't know of any way to pass that $id variable back over to the parent.

View 3 Replies View Related

Onclick Defined Variable - Print Variable Some Place In Document

May 28, 2007

i'm not really sure how to explain this, since I know nothing about javascript, so i'll try and illustrate by the use of php (hope it makes sence)

I have a set of different links, like:

<a href="link.com?page=text1">text 1</a>
<a href="link.com?page=text2">text 2</a>
<a href="link.com?page=text3">text 3</a>
etc, where page is dynamic and can be anything I chose..

Another place in the same document, I echo out what the page variable is, like:

echo "$page";
so when clicking "text 1" the echo will output what i've defined the page to be, in this case "text1" ..

So I want to be able to click the links and change the output of the echo all depending on what i've defined in the link - without refreshing the page!

Is there any easy way to do this?

View 2 Replies View Related

ChangeYear - GetFullYear - SetFullYear Functions - Extract The 4-digit Value From The Today Variable And Store The Value In A Variable Named Year

Oct 13, 2009

a.) specify two parameters for the changeYear function: today and holiday.

function changeYear(today)(holiday){

b.) in the first line of the above function, use the getFullYear() date method to extract the 4-digit value from the today variable and store the value in a variable named year.

first line

c.) in the second line; use the setFullYear() date method to set the full year of the holiday date object to the value of the year variable.

second line

d.) in the third line, use a conditional operator on the year variable. The test condition is whether the value of the holiday date object is less than the today date object. If it is, this means that the event has already passed in the current year and the value of the year variable should be increased by 1.

third line

e.) in the fourth line of the function, again set the full year value of the holiday date object to the value of the year variable.

View 3 Replies View Related

Setting Variable Equal To Php Variable By Passing A Parameter?

Aug 12, 2011

Code:I am having problems with the following. I am wanting to hide <tr> in my table (employees) and only show employees that are in the selected department (selected via dropdown box).I need to set a javascript array to a php array. I am looping and assigning the array and am wanting to pass a javascript variable as the index in php array. I have marked my problem lines in red. Thanx for any help.

<script type="text/javascript" >
function display_elements()
{
var departments = new Array;

[code]....

View 1 Replies View Related

Global Variable Glitch - Can Only Access The Variable On The Second Call

Dec 9, 2011

I am simply trying to use a global variable in javascript, but can only access the variable on the second call. I can't find anything that relates to this through my searches. My application is supposed to query the server for XML that tells me which years and months are available to put into combo boxes. I want to store this xml in a global variable to access it later.

[Code]....

View 6 Replies View Related

External File The LoadTabs Variable Will Not Allow To Pass It A Variable

Dec 1, 2009

I start outside of the external JS file by: reviews.init(); reviews.initialiseContent('comment'); This loads my data and loads + sets the comment tab as default. My problem is that in the external JS file (shown below) the loadTabs variable will not allow me to pass it a variable: contentDiv.onclick = this.initialiseContent; Whenever I pass a variable here it errors, am I setting this up correctly, should I be using prototype for my this. variables? Interested to hear back on if this structure of code is the right way to go about this and also how I can pass a variable in this way :)

[Code]....

View 2 Replies View Related

JQuery :: Defining A Part Of A Variable With Another Variable?

May 15, 2011

I am trying to define a variable as follows:

var music_id = $(this).attr('id');
var mix_class = $('#le' + music_id);

In other words, if music_id is mix3, I want mix_class to be #lemix3.The above code is not working for me and I would like assistance as to the syntax to produce such a result

View 2 Replies View Related

Pass Dynamic Php Variable To Script Variable?

Jun 9, 2011

I tried this code but i got an error on the it said Syntax error code...

View 6 Replies View Related

Undefined Variable Error, Even Though Variable Is Defined?

Aug 24, 2010

I have a php page in which I declared a js variable... right at the top of the page...

<script type="text/javascript">
var tester = 0;
</script>

[code]....

View 2 Replies View Related

Get A Variable From A Remote Page And Define As Variable?

Apr 26, 2011

I have a programing problem that have been around for ages. I have search on google using several expressions and words and after hours of digging i'm still unable to do it.I would like to get a value from a HTML page hosted remotely with an inconstant value. Then define this value and name as a javascript variable and apply or show in my page.P.S. Is there any way to make a domain lookup in javascript? I mean a user enters a domain and the script converts to an ip and shows to the user. If not thanks, probably it can only be done in the server side...

View 6 Replies View Related

JQuery :: $("selector" - Code) And .html() - Load Div In A Variable - Modify It In Another Variable And Then Change The Document Injecting The Contents

Dec 13, 2011

I want to load an html div in a variable, modify it in another variable; and then change the document injecting the contents.

1. I load the html to be changed in a variable (code)
2. I modify an attribute of <param> using attr() and I put the result in a var (newcode)
3. I change the html in the doc

I've used the debugger, and all steps give the expected results, except of newcode.html(), which is a null string. Why?

[Code]....

View 8 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved