Click here to Skip to main content
15,884,388 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
Questioninstallation Pin
thangvel8-Oct-09 11:54
thangvel8-Oct-09 11:54 
AnswerRe: installation Pin
Richard MacCutchan14-Oct-09 6:07
mveRichard MacCutchan14-Oct-09 6:07 
AnswerRe: installation Pin
Iranian MM7-Sep-11 9:40
Iranian MM7-Sep-11 9:40 
Questiondownload php code Pin
udch7-Oct-09 1:24
udch7-Oct-09 1:24 
AnswerRe: download php code Pin
EliottA7-Oct-09 2:41
EliottA7-Oct-09 2:41 
QuestionI need some help Pin
robertbarzyk6-Oct-09 12:55
robertbarzyk6-Oct-09 12:55 
AnswerRe: I need some help Pin
Marc Firth6-Oct-09 22:02
Marc Firth6-Oct-09 22:02 
AnswerRe: I need some help Pin
fly9047-Oct-09 5:01
fly9047-Oct-09 5:01 
I'm in a lecture and I'm bored. I wrote this quick little example which should do it for you.

It assigns a hreflang attribute to each link which has been clicked.

The code uses jQuery and is self explanatory.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<title>Example</title>
	<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
	<script type="text/javascript">
		
		$(document).ready(function() { // When the page has loaded

			$('#links').children('a').click(function() { // Assign a click event to each link in the div #links
			
				$(this).unbind('click').attr('hreflang','en'); // Remove the onclick binding and assign the hreflang attribute to en
				
				checkAllClicked(); // Check is all links have been assigned hreflang's.
				
			});

		});
		
		var allClicked = false;
		function checkAllClicked()
		{
			allClicked = true;	// Set allCLicked to true, incase all have been clicked.
			
			$('#links').children('a').each(function() // For each link in #links
			{
				if (typeof $(this).attr('hreflang') == 'undefined') // If a link's hreflang has not be set,
				{
					allClicked = false;	// allClicked equals false.
				}
			});
			if (allClicked) // If all links have been visited; redirect to another page.
			{
				window.location = 'redirectedto.html';
			}
		}
		
	</script>
</head>
<body>

	<div id="links">
	
		<a href="target.html" target="_blank" title="New Window">1</a>
		<a href="target.html" target="_blank" title="New Window">2</a>
		<a href="target.html" target="_blank" title="New Window">3</a>
		<a href="target.html" target="_blank" title="New Window">4</a>

	</div>
	
</body>
</html>


If at first you don't succeed, you're not Chuck Norris.

Questionfetch data Pin
udch6-Oct-09 3:18
udch6-Oct-09 3:18 
AnswerRe: fetch data Pin
cjoki12-Oct-09 5:41
cjoki12-Oct-09 5:41 
GeneralRe: fetch data Pin
udch19-Oct-09 9:32
udch19-Oct-09 9:32 
QuestionPython Tutorials?? Pin
TGeist5-Oct-09 17:44
TGeist5-Oct-09 17:44 
AnswerRe: Python Tutorials?? Pin
ClockEndGooner26-Oct-09 9:54
ClockEndGooner26-Oct-09 9:54 
AnswerRe: Python Tutorials?? Pin
Asday30-Nov-09 1:30
Asday30-Nov-09 1:30 
Questionseeking help for builiding a web site urgent Pin
lalwani.sydney5-Oct-09 16:01
lalwani.sydney5-Oct-09 16:01 
AnswerRe: seeking help for builiding a web site urgent Pin
Marc Firth5-Oct-09 22:43
Marc Firth5-Oct-09 22:43 
AnswerRe: seeking help for builiding a web site urgent Pin
AlexeiXX39-Oct-09 9:29
AlexeiXX39-Oct-09 9:29 
QuestionPaypal and shopping online Pin
sharkbc2-Oct-09 15:53
sharkbc2-Oct-09 15:53 
AnswerRe: Paypal and shopping online Pin
Marc Firth4-Oct-09 22:18
Marc Firth4-Oct-09 22:18 
AnswerRe: Paypal and shopping online Pin
Marc Firth4-Oct-09 22:19
Marc Firth4-Oct-09 22:19 
QuestionRSS how to - Step by step Pin
sharkbc1-Oct-09 17:30
sharkbc1-Oct-09 17:30 
AnswerRe: RSS how to - Step by step Pin
enhzflep1-Oct-09 18:47
enhzflep1-Oct-09 18:47 
GeneralRe: RSS how to - Step by step Pin
sharkbc2-Oct-09 15:55
sharkbc2-Oct-09 15:55 
Questionhow to extract a cab file in python - any module available?? Pin
anand mohan12330-Sep-09 14:22
anand mohan12330-Sep-09 14:22 
AnswerRe: how to extract a cab file in python - any module available?? Pin
David Skelly30-Sep-09 22:28
David Skelly30-Sep-09 22:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.