/    Sign up×
Community /Pin to ProfileBookmark

Load new page & specify a find string

I want to load a new page (into the browser) and specify the “find” string so I can quickly search for all occurences of the string. Using Firefox all uses of the string can be automatically highlighted. The page to be loaded is a result of a search so I don’t want to enter the same string twice!

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@KorDec 08.2004 — Do you mean you need to pass a value from a page to another? You may use same method as a passed query. Ex:

in first page
[code=php]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<script language="JavaScript" type="text/JavaScript">
function goP(){
var val= document.getElementById('txt').value;
location.href='next.html'+'?'+val;
}
</script>
</head>
<body>
Enter the value to be passed<br>
<input id="txt" type="text"><br>
<input type="button" value="Pass the value input to next page" onclick="goP('txt')">
</body>
</html>
[/code]


in "next.html" page:
[code=php]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<script language="JavaScript" type="text/JavaScript">
function getVal(){
var val = location.href.split('?')[location.href.split('?').length-1];
alert('The value passed is: '+val)
}
onload=getVal;
</script>
</head>
<body>

</body>
</html>
[/code]
×

Success!

Help @tommcpharlin spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...