how can i create a dynamic link section like that of sitepoint.com in which the title of the page currently being browsed and previously browsed can be displayed in a section of the page.
I am trying to make a script that will display a random banner, and also cloaks the url in the browser status bar in the bottom left. I have found these 2 seperate scripts on the net, this one was for cloaking the url <a onclick="parent.location.href='[URL'; return event.returnValue=false" href=[URL]>Anchor Text</a>
And this one was for the random banner <script language="JavaScript"><!-- //Javascript Created by Computerhope [URL] //store the quotations in arrays images = new Array(4); images[0] = "<a href = '[URL]'><img src='[URL]' alt='Visit Computer Hope'></a>"; .....
I have a program that allows the user to input a product number from 1 to 5, and the amount of each product number sold. After all values are added, the program is supposed to calculate each product's total retail value, as well as the total retail value of all five products combined. The program runs fine, up until the end. I got all my alert boxes working, and the program is doing the multiplication as it is supposed to. However, when I get to the end, I receive "Last weeks total retail sales are: $NaN".
My code: var productNum; var quantity; var prodPrice1 = 2.98; var prodPrice2 = 4.50; var prodPrice3 = 9.98; var prodPrice4 = 4.49; var prodPrice5 = 6.87; var total1; var total2; var total3; var total4; var total5; productNum = window.prompt( "Enter a Product Number (1,2,3,4,5):", "1" ); quantity1 = window.prompt( "Enter the quantity sold" ); productNum = window.prompt( "Enter a Product Number (1,2,3,4,5):", "1" ); quantity2 = window.prompt( "Enter the quantity sold" ); productNum = window.prompt( "Enter a Product Number (1,2,3,4,5):", "1" ); quantity3 = window.prompt( "Enter the quantity sold" ); productNum = window.prompt( "Enter a Product Number (1,2,3,4,5):", "1" ); quantity4 = window.prompt( "Enter the quantity sold" ); productNum = window.prompt( "Enter a Product Number (1,2,3,4,5):", "1" ); quantity5 = window.prompt( "Enter the quantity sold" );
total1 = document.writeln("Total for product 1 is $" + (prodPrice1 * quantity1) + "<br />"); total2 = document.writeln("Total for product 2 is $" + (prodPrice2 * quantity2) + "<br />"); total3 = document.writeln("Total for product 3 is $" + (prodPrice3 * quantity3) + "<br />"); total4 = document.writeln("Total for product 4 is $" + (prodPrice4 * quantity4) + "<br />"); total5 = document.writeln("Total for product 5 is $" + (prodPrice5 * quantity5) + "<br />"); document.writeln( "<h1>Last weeks total retail sales are: $" + ( total1 + total2 + total3 + total4 + total5) + "</h1>" );
i am trying to add a Link dynamic to a and Image that i am creating dynamic too to a table, here is the code that i am using to add the image but i dont now how to add the link to the images.
Code: var cell6 = row.insertCell(5); var element6 = document.createElement("img");
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:
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?
I'm trying to make a username form validation combined with ajax but I'm stuck at 1 point. I need to use a var that is outside of my $.get() function so that I can add the function to the validate plugin.
This is what I have:
As you can see, I'm trying to change the value of "var result" to true, but since that is outside of my $.get() it doesn't seem to happen. I tried to put the return command inside the $.get function, but then my validator always keep saying it's a false check.
Is there anyway I can call that var inside my $.get function?
I have a few html fields in a form that use PHP in order to calculate a combined value and then inserting it into the database. However, I would want that value to be displayed to the user as well before they insert it, just so they can verify that the value is correct. But how do I go about and do this?
It is probably very simple, but I'm a PHP programmer and have very little knowledge of JavaScript. Basically this is what I would want:
<field 1> -20 +(or -, depending on user input) <field 2> Result of that to be displayed in <field 3>
However, I only want the -20 to calculated when something is entered in <field 1> so that it does not say -20 in the output field before the user even started typing a value.
I'm trying to create a webpage where users can click on a dynamically generated set of questions:
<?php do { ?> <p><?php echo $row_rsQuestions['question_text']; ?><?php echo $row_rsQuestions['question_type']; ?></p> <?php } while ($row_rsQuestions = mysql_fetch_assoc($rsQuestions)); ?>
and by clicking on a particular question, there will be an update for their particular listing of personal questions in a MySql database. I know how to create the database update part, but I think that I would need to javascript to:
1) tell my page that it's time to update (i.e. add a particular question as soon as they click it)
2) pass along the correct variable to the database update portion of the page.
We would like to create a new website and have that do some dynamic things based on login id. First all we would like to send you do a different home page based on this information, it might be one of several companies. This may also be tied to what URL you clicked but not necessarily. The second thing we would like to do is display only the products that you are eligible for based on your login information. We would like to use images as a link here and if you can sell one product you get one image or maybe bypass and go directly to that section, but if you can sell two or more then those images as links show up as available.
The final thing we want to do is to populate the top 3 or so items you perform on the site as quick links. After all that, are there tools or items I should study to accomplish this task? I'm not sure if I need to mix in some sort of third party analytical tool with the asp.net site or what. The only other thing that I think we can do with ajax is have them say enter a a vehicle identification number and without looking like a screen reload use ajax to show the additional information such as year make and model that are decoded from the vin, but I'm just starting to look into this.
I have to do a project, the requirements i have got are, same link on multiple pages should lead to a single page on client's site, but the page should be different for each link clicked.
What i understand from this is, we will send parameters with each link to a JS or php file and then generate a dynamic page each time, but i am not clear how many files we need to call and what will be the sequence. I want to implement this in JS and php.
how to implement it with JS and PHP if we send parameters with the url and if we don't send any parameters.
I'm having a small problem, I'm trying to reach this: (This is just regular JavaScript).
But, when I'm trying to get it working on Mozilla FireFox (Combined with MacBook Pro), it fails. So I want to try with jQuery, but I don't know about it,
I have 41 <select> fields in a form. When a user makes any selection or change to any dropdown I want to do ajax and send the values of 41 dropdown's to a php page which will compute the values and return a single value which should be displayed in a div.
I want to make a dynamic 4 drop down menus with AJAX and PHP/mySQL, like this:
Category->dynamic subCategory
County->dynamic cityCounty
Is there any good tutorial that can teach me how to do this? I managed to have that Category dynamicly loads subCategory and that County dynamicly loads cityCounty but I ran into a problem when I already picked subCategory and than went on to pick a County, because of the reload.this function in javascript my subCategory gets lost. Can anyone point me in right direction?
I tried to add links to open local xml files in browser in a dynamic table cells. I need help. I tried all ways but I think I miss something.I can open them without table just by document.write(xmlfile location).
I'm trying to put together a mockup website. to test my knowledge on javascript.So my problem now is putting dynamically a css style using javascript. The style that I need to dynamically put is a hover style, visited style, and link style.
Code: function moveBar() { var bar = document.getElementById("taskbar");
I'm not very experienced with jQuery yet and after a while of trying and searching I decided to ask for help here:
I'm using jCarousel Lite, the "Custom Widget" scenario (click in the list on the left)[url]
When clicking on a image in the carousel, the larger image is shown immedeately. I'm trying to achieve a fadeout, fadein effect. Doesn't need to be a crossfade, a fade out to white, fade in from white is fine.
My 'bare' code (this works, with instant showing of pictures, without any fades)[code]...
I am trying to find a tutorial and learn how to create an option list and when a user selects an option they are automatically directed to a new url. I'd rather not have to use a submit button, but i guess it would be nice to learnt that too.
The thing i'm having difficulty with is what function it would use? onchange, onclick etc. I'm not really sure what to search for, and how it is described.
I currently have the follwoing javascript function: Code:
/** * ask question, if true goto X */ function watsConfirmAction( question, letsgoto ) { // ask question if ( confirm( question ) ) { // on YES goto location location.href = letsgoto; } } which is used as follows:
If a user doesn't have javascript, for whatever reason, this will fail to send them anywhere. is there a better way of doing this to allow for javascript non compliant browsers?
I have been using PHP for a little while but just getting into JavaScript and really need to dynamically update dropdown boxes read from a mySQL database. There are three dropdown boxes, the first reads in fine. The second dropdown box then gets populated using the selection from the first as the condition in mySQL and the same again for the third.The page refreshes itself after the selection from the first box using JavaScript and populates the second using the PHP _GET method (this works fine). The issue is when I need to do this again for the second time because my JS is only set up to do it once and I don't no how to amend it. Also it will have to do it a third time because I need that info to complete the form and update the DB.
<SCRIPT language=JavaScript> function reload(form){ var val=form.cat.options[form.cat.options.selectedIndex].value; self.location='bookf.php?cat='+val ; } </script>
echo "<form method=post name=f1 action=''>"; ////////// Starting of first drop downlist ///////// echo "<select name='cat' onchange="reload(this.form)"><option value=''>Select a Film</option>"; while($noticia2 = mysql_fetch_array($quer2)) { if($noticia2['FilmID']==@$cat){echo "<option selected value='$noticia2[FilmID]'>$noticia2[FilmTitle]</option>"."<BR>";} else{echo "<option value='$noticia2[FilmID]'>$noticia2[FilmTitle]</option>";} }
echo "</select><br />"; ////////////////// This will end the first drop down list /////////// ////////// Starting of second drop downlist ///////// echo "<select name='subcat' onchange="reload(this.form)"><option value=''>Select a Date</option>"; while($noticia = mysql_fetch_array($quer)) { if($noticia2['FilmID']==@$cat){echo "<option selected value='$noticia2[FilmID]'>$noticia2[Date]</option>"."<BR>";} else{echo "<option value='$noticia[FilmID]'>$noticia[Date]</option>";} } echo "</select><br />"; ////////////////// This will end the second drop down list ///////////
////////// Starting of third drop downlist ///////// echo "<select name='subcat2' onchange="reload(this.form)"><option value=''>Select a Time</option>"; while($noticia = mysql_fetch_array($quer3)) { if($noticia2['FilmID']==@$cat){echo "<option selected value='$noticia2[FilmID]'>$noticia2[Time]</option>"."<BR>";} else{echo "<option value='$noticia[FilmID]'>$noticia[Time]</option>";} } echo "</select><br />"; ////////////////// This will end the third drop down list ///////////