want this scripts...

This is a discussion on "want this scripts..." within the JavaScript Forum section. This forum, and the thread "want this scripts... are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jun 10th, 2008, 03:41
New Member
Join Date: Jun 2008
Location: er
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
want this scripts...

i want to make dictionary and translation web site via javascripts becaus i dont want hava a database..i have 1 example scripts (search) and it can make like a dictionary without need database...but is so slow when put many word like that :

c++; item[c]=new Array("web yang best.htm","","best","baik,mebantu","di putera dot com.");
c++; item[c]=new Array("web yang best.htm","","best","baik,mebantu","di putera dot com.");
c++; item[c]=new Array("web yang best.htm","","best","baik,mebantu","di putera dot com.");
(more than 10000 word i put)

anybody have a java script to make dictionary and translation funcition..hope can help me..

example javascripts :

Code: Select all
<!-- TWO STEPS TO INSTALL SITE SEARCH:

  1.  Copy the coding into the HEAD of your HTML document
  2.  Add the last code into the BODY of your HTML document  -->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document  -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">


<!-- Begin
var item = new Array();

/* Here is where all the magic happens.  
    Just enter as many additional pages that
    that you want to search, then fill in the
    additional listings for each page.
*/

// "Page Name","path","Page Title","Many,Key,Words","Descriptive Comments"

c=0; item[c]=new Array("index.html","","DemoSite","index,main,start,home,front","Demonstration search engine data about an imagined but probable internet site.");
c++; item[c]=new Array("about.htm","","About Me","about,author,contact,email,who","Contact details and general information about the creator of the site and what the site is about.");
c++; item[c]=new Array("links.htm","","Links page","links,more,where,similar,friends","Links to my favourite sites which I find interesting. Other friends sites which have similar interests to my own.");
c++; item[c]=new Array("main.htm","main/","Main Page","content,main,focus","The main part of my site which contains what you have come to see. Lots of stuff like that and more great things. All in a sub directory.");
c++; item[c]=new Array("logo.jpg","main/images/","Link Logo","link,image,logo,graphic","The logo.jpg is just a small image which you can place on your site as a link to me. It's in a second level subdirectory.");

page="<html><head><title>Search Results</title></head><body bgcolor='white'><center><table border=0 cellspacing=10 width=80%>";


function search(frm) {
win = window.open("","","scrollbars");
win.document.write(page);
txt = frm.srchval.value.split(" ");
fnd = new Array(); total=0;
for (i = 0; i < item.length; i++) {
fnd[i] = 0; order = new Array(0, 4, 2, 3);
for (j = 0; j < order.length; j++)
for (k = 0; k < txt.length; k++)
if (item[i][order[j]].toLowerCase().indexOf(txt[k]) > -1 && txt[k] != "")
fnd[i] += (j+1);
}
for (i = 0; i < fnd.length; i++) {
n = 0; w = -1;
for (j = 0;j < fnd.length; j++)
if (fnd[j] > n) { n = fnd[j]; w = j; };
if (w > -1) total += show(w, win, n);
fnd[w] = 0;
}
win.document.write("</table><br>Total found: "+total+"<br></body></html>");
win.document.close();
}
function show(which,wind,num) {
link = item[which][1] + item[which][0]; 
line = "<tr><td><a href='"+link+"'>"+item[which][2]+"</a> Score: "+num+"<br>";
line += item[which][4] + "<br>"+link+"</td></tr>";
wind.document.write(line);
return 1;
}
//  End -->
</script>
</HEAD>

<!-- STEP TWO: Copy this code into the BODY of your HTML document  -->

<BODY>

<center>

<form method=get action="javascript:void(0)" onsubmit="search(this); return false;">
<tr><td><input type=text name=srchval value=""><input type=submit value="Search"></td></tr>
</form>

</center>


<!-- Script Size:  3.16 KB -->
Reply With Quote

  #2 (permalink)  
Old Jun 10th, 2008, 10:54
Reputable Member
Join Date: Mar 2008
Location: Chester, UK
Age: 17
Posts: 405
Thanks: 2
Thanked 26 Times in 26 Posts
Re: want this scripts...

You'd probably need a database because of the sheer volume of data, Javascript is client side, Requiring the user to donwload all that data (dictionaries are pretty big).

Why is it you don't want a database?

Plus you could always look into ajax, that way the javascript can call the data from the database, without refreshing the page.
Reply With Quote
  #3 (permalink)  
Old Jun 15th, 2008, 22:52
Junior Member
Join Date: Nov 2006
Location: Chicago
Age: 33
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Re: want this scripts...

Quote:
Originally Posted by Bocaj View Post

Why is it you don't want a database?
I'm going to guess because he doesn't want to learn anything more complicated than CTRL-C and CTRL-V.

OP: What you're asking for isn't something you can just slap into an HTML document. It's slowing down because browsers are built to handle that kind of a load.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Scripts MetallicWarfare PHP Forum 0 Aug 3rd, 2007 12:03
need some scripts habitatxskate Web Page Design 7 Feb 12th, 2007 19:04
CGI Scripts? kaligula1234 PHP Forum 4 Mar 30th, 2006 21:24
Mail scripts ricky1911 PHP Forum 2 Dec 13th, 2005 23:12


All times are GMT. The time now is 14:43.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43