|登录 |注册

12
返回列表 发新帖
楼主: ycyc123
打印 上一主题 下一主题

怎样用search function 在webpage???

[复制链接]
ycyc123
2011-2-23 11:31 PM
我的website没用弄上网的哦...
只是在我的网站可以search罢了哦...
exp,我开一个webpage里面存有 sony ericsson xperia x10资料...
然后我开我的website,在search那边写x10,就自动出x10的资料...
明白我的意思吗??
Dhilip89
2011-2-24 11:05 PM
C++可以用CGI,但只能在Server-side实现。
goodhermit95
2011-2-25 06:19 PM
用google search最方便了...因为你不懂怎样写search function
宅男-兜着走
2011-2-25 07:27 PM
还有个比较蠢的方法。

用 javascript 就能实现了。
http://www.cev.washington.edu/lc/CLWEBCLB/jst/js_string.html

比如说你的内容是。

title : testing content
content: the content.

title : testing content 1
content: the content 1.

那么你把你的内容写进 javascript array

  1.    [
  2.      {title: "testing title", content: "testing content"},
  3.      {title: "testing title 1", content: "testing content 1"},
  4.   ]
复制代码
然后就 forloop array, 用 js 的 match() function, 或 indexof() 来找。
符合到的话, 就 print 出来。

搞定, 收工!
您需要登录后才可以回帖 登录 | 注册

JBTALKS.CC |联系我们 |隐私政策 |Share

GMT+8, 2025-3-11 06:29 AM , Processed in 0.082198 second(s), 20 queries .

Powered by Discuz! X2.5 © 2001-2012 Comsenz Inc.

本论坛言论纯属发表者个人意见,与本论坛立场无关
Copyright © 2003-2012 JBTALKS.CC All Rights Reserved

Dedicated Server powered by iCore Technology Sdn. Bhd.

合作联盟网站:
JBTALKS 马来西亚中文论坛 | JBTALKS我的空间 | ICORE TECHNOLOGY SDN. BHD.
回顶部