js challenge...2

I have a very good solution from Tom at: http://www.experts-exchange.com/questions/28745347/js-challenge.html
That solution works when both the hyperlink and anchor tag are on the same page.

Expected functionality: User clicks on Go to blink test hyperlink then Blink Test include with the anchor tag starts blinking for a few times. All at on the same page.

But, for the current question,  Go to blink test hyperlink is on index.html and Blink Test is on target.html. Please see the image below which may help to illustrate the need.
jsIndexToTarget
LVL 34
Mike EghtebasDatabase and Application DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Tom BeckCommented:
Something like this would work. Just adding a query to the link href: <a href="target.html?lnk=UploadVideo">

index.html
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>Index Document</title>
</head>
<body>
<a href="target.html?lnk=UploadVideo">Go to blink test</a>
</body>
</html>

Open in new window

target.html
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Untitled Document</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
	<script>
	$(document).ready(function(){
		var t;
		var urlSearch = getParameterByName('lnk');
		if (urlSearch == "UploadVideo") {		
			var a = $('#UploadVideo'),blinks = 0;
			$('#UploadVideoLink')[0].click();
			t = setInterval(function() {
				a.fadeOut(100, function() {
					a.fadeIn(100);
					(blinks === 2) ? clearInterval(t) : blinks++;
				});
			}, 800);
		}
	});
	function getParameterByName(name) {
		name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
		var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
			results = regex.exec(location.search);
		return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
	}
	</script>
</head>

<body>
<a href="#UploadVideo" id="UploadVideoLink">Go to blink test</a>
<p>
dhhhhhhhhhhhhhhh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hhh<br/>
dhhhhhhhhhhhhhhhhhhhhhhhhhhhhh<br/><br/>
dhhhhhhhhhhhhhhhhhhhhhhhhhhhhh<br/><br/>
dhhhhhhhhhhhhhhhhhhhhhhhhhhhhh<br/><br/>
<a id="UploadVideo">Blink Test</a>
</body>
</html>

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mike EghtebasDatabase and Application DeveloperAuthor Commented:
I am shortly adding a new question asking for a little bit more functionality.

Suppose in the target.html I have to anchors like:

<a id="UploadVideo1">Blink Test -  1</a>
<a id="UploadVideo2">Blink Test - 2</a>

How to revise the calling hyperlink and how to revise the code in the target.html to navigate to the corresponding anchor and start blinking it. FYI, I have about 5 such anchor tags so, it will be helpful to have minimum lines of code by somehow passing a id parameter to it.

<a href="target.html?lnk=UploadVideo1">Go to blink test 1</a>
<a href="target.html?lnk=UploadVideo2">Go to blink test 2 </a>
Mike EghtebasDatabase and Application DeveloperAuthor Commented:
Thank you.
Tom BeckCommented:
I'll handle the new part in the new question.

Thanks for the points.
Julian HansenCommented:
How to revise the calling hyperlink and how to revise the code in the target.html to navigate to the corresponding anchor and start blinking it. FYI, I have about 5 such anchor tags so, it will be helpful to have minimum lines of code by somehow passing a id parameter to it.
The solution I posted in your other question will do this with a simple change

Add this to the JavaScript
if (window.location.hash != '') hashChanged();

Open in new window

Review sample here
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.