الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

طلب كود Search

مغلق
بدأه css في 29 أكتوبر 2007 · 4 رد · 1,135 مشاهدة · في قسم البرمجة بــ Javascript
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم

الله يعطيكم العافية ابغى الكود تبع

search function

بالجافا سكريبت

#2

السلام عليكم

بلييييييييز

ساعدوني

مطلوب مني تقديم موقع و ابغى احط فيه بحث

ردووووووووووو بسرعه

لأن كل دقيقه محتاجتها

بحثت في مواقع اجنبيه

بس بصراحه ما فهمت الكود

#3

ما المقصود

البحث داخل الصفحة / او ادراج محرك البحث لشركة قوقل داخل صفحتك ؟

او هناك مقصد آخر ....

#4

انا ابغى اضيف خدمة البحث للموقع تبعي لقيت الكود بس ابغى اغير فيه نضع هذي الجزئيه في head<script language="JavaScript"> <!-- Original by http://javascript.internet.com More javascripts http://www.hypergurl.com --> var NS4 = (document.layers); // Which browser? var IE4 = (document.all); var win = window; // window to search. var n = 0; function findInPage(str) { var txt, i, found; if (str == "") return false; // Find next occurance of the given string on the page, wrap around to the // start of the page if necessary. if (NS4) { // Look for match starting at the current point. If not found, rewind // back to the first match. if (!win.find(str)) while(win.find(str, false, true)) n++; else n++; // If not found in either direction, give message. if (n == 0) alert("Not found."); } if (IE4) { txt = win.document.body.createTextRange(); // Find the nth match from the top of the page. for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) { txt.moveStart("character", 1); txt.moveEnd("textedit"); } // If found, mark it and scroll it into view. if (found) { txt.moveStart("character", -1); txt.findText(str); txt.select(); txt.scrollIntoView(); n++; } // Otherwise, start over at the top of the page and find first match. else { if (n > 0) { n = 0; findInPage(str); } // Not found anywhere, give message. else alert("Not found."); } } return false; } </script>ونضع هذا الجزء في المكان اللي ابغى ايقونة البحث تطلع فيه<form name="search" onSubmit="return findInPage(this.string.value);"> <div align="center"> <p><font size=3> <input name="string" type="text" size=20 onChange="n = 0;"> </font> <input type="submit" value="بحث"> </p> </div> </form>بس أنا ابغي اغير لون الايقونه مو عاجبني ماني عارفه كيف؟؟؟؟؟؟؟انا ابغى اضيف خدمة البحث للموقع تبعي لقيت الكود بس ابغى اغير فيه نضع هذي الجزئيه في head<script language="JavaScript"> <!-- Original by http://javascript.internet.com More javascripts http://www.hypergurl.com --> var NS4 = (document.layers); // Which browser? var IE4 = (document.all); var win = window; // window to search. var n = 0; function findInPage(str) { var txt, i, found; if (str == "") return false; // Find next occurance of the given string on the page, wrap around to the // start of the page if necessary. if (NS4) { // Look for match starting at the current point. If not found, rewind // back to the first match. if (!win.find(str)) while(win.find(str, false, true)) n++; else n++; // If not found in either direction, give message. if (n == 0) alert("Not found."); } if (IE4) { txt = win.document.body.createTextRange(); // Find the nth match from the top of the page. for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) { txt.moveStart("character", 1); txt.moveEnd("textedit"); } // If found, mark it and scroll it into view. if (found) { txt.moveStart("character", -1); txt.findText(str); txt.select(); txt.scrollIntoView(); n++; } // Otherwise, start over at the top of the page and find first match. else { if (n > 0) { n = 0; findInPage(str); } // Not found anywhere, give message. else alert("Not found."); } } return false; } </script>ونضع هذا الجزء في المكان اللي ابغى ايقونة البحث تطلع فيه<form name="search" onSubmit="return findInPage(this.string.value);"> <div align="center"> <p><font size=3> <input name="string" type="text" size=20 onChange="n = 0;"> </font> <input type="submit" value="بحث"> </p> </div> </form>بس أنا ابغي اغير لون الايقونه مو عاجبني ماني عارفه كيف؟؟؟؟؟؟؟

#5
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
<title>New Page 1</title>
<script language="JavaScript"> 
<!-- Original by http://javascript.internet.com More javascripts http://www.hypergurl.com -->
	var NS4 = (document.layers);
	// Which browser?
	var IE4 = (document.all);
	var win = window; 
	// window to search.
	var n = 0;
	function findInPage(str) { var txt, i, found; if (str == "") return false; 
	// Find next occurance of the given string on the page, wrap around to the // start of the page if necessary. 
	if (NS4) { 
	// Look for match starting at the current point. If not found, rewind // back to the first match. 
	if (!win.find(str)) while(win.find(str, false, true)) n++; else n++; 
	// If not found in either direction, give message. 
	if (n == 0) alert("Not found."); } if (IE4) { txt = win.document.body.createTextRange(); 
	// Find the nth match from the top of the page. 
	for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) { txt.moveStart("character", 1);
	txt.moveEnd("textedit"); } 
	// If found, mark it and scroll it into view.
	if (found) { txt.moveStart("character", -1); 
	txt.findText(str); 
	txt.select(); 
	txt.scrollIntoView(); n++; } 
	// Otherwise, start over at the top of the page and find first match. 
	else { if (n > 0) { n = 0; findInPage(str); } 
	// Not found anywhere, give message. 
	else alert("Not found."); } } return false; } 
</script>
<style>
input{
	height: 23px;
	font-family: Tahoma;
	font-size: 10pt;
	text-align: center;
	border-width: 1px;
	border-style: solid;
	border-color: #7F9DB9;
}
.field{
	color: #636194
	background-color: #FFFFFF;
}
.button{
	width: 80px;
	color: #FFFFFF;
	background-color: #636194;
}
</style>
<script>
function buttonDown(button){
	button.style.background='#FFFFFF';
	button.style.color='#636194';

}
function buttonUp(button){
	button.style.background='#636194';
	button.style.color='#FFFFFF';
}
</script>
</head>
<body>
انا ابغى اضيف خدمة البحث للموقع تبعي لقيت الكود بس ابغى اغير فيه نضع هذي الجزئيه 
في head ونضع	 
هذا الجزء في المكان اللي ابغى ايقونة البحث تطلع فيه
<form name="search" onSubmit="return findInPage(this.string.value);">
 <div align="center">
  <p><font size=3> <input name="string" type="text" class="field" size=20 onChange="n = 0;">
   </font> <input type="submit" class="button" value="بحث" onmousedown="buttonDown(this);" onmouseup="buttonUp(this);"> </p> </div> </form>
بس أنا ابغي اغير لون الايقونه مو عاجبني ماني عارفه كيف؟؟؟؟؟؟؟انا </body>
</html>

هذا الموضوع مغلق.

مواضيع مشابهة