WikiFX搜索插件調用說明文檔
本文檔用於指導程序開發人員,在自己的網站中構建一個交易商搜索框,然後根據輸入內容,在新窗口中打開www.fxeyema.com的匹配交易商列表。
第一步:創建容器
在頁面的<body></body>中合適的位置添加一個div,並自定義一個唯一id,例如<div id=“div_jiaoyishang”></div>,這個div作為容器,用於確定js代碼生成的html片段最終在頁面上展現出可見搜索框的位置。
第二步:調用js代碼[方式一:基本調用,修改url參數值實現配置參數]
01.
02.
03.
<script type=“text/javascript” src=“//osshead.interface003.com/headfoot/fxeye/Content/js/tradersearch.js?id=div_jiaoyishang&width=350px&height=30px&buttomwidth=50px&border=1px&color=#f4c830&ts=” + Math.random()></script>
Copy
[方式二:javascript對象設置,修改js對象屬性值配置參數]
01.
02.
03.
04.
05.
06.
07.
08.
09.
10.
11.
12.
13.
14.
15.
<script type=“text/javascript”>
var fx = new Object();
fx.id=“div_jiaoyishang”;
fx.width=“350px”;
fx.height=“30px”;
fx.buttomwidth=“50px”;
fx.border=“1px”;
fx.color=“#f4c830”;
var script=document.createElement(“script”);
script.type=“text/javascript”;
script.src=“//osshead.interface003.com/headfoot/fxeye/Content/js/tradersearch.js?id=”+ fx.id
+“&border=“+fx.border+”&color=“+fx.color+”&ts=” + Math.random();
document.getElementsByTagName(‘body’)[0].appendChild(script);
</ script>
Copy
參數相關說明
Parameter Name
Parameter Type
是否必填
參數說明
id
String
是
指定輸入框再哪個位置生成,即第二步創建的那個div的id
width
String
否
Configure the total width of the search box, namely the container width
height
String
否
設置總高度
buttomwidth
String
否
Width of the button on the left, used to adjust the input box and buttons
border
String
否
搜索框的邊框粗細,可根據輸入框的整體大小設置
color
String
否
背景顏色
備註:第二步的js代碼放在容器div的後面,推薦放在body的最底下
實際案例
操作說明:在搜索框內輸入公司名稱或監管號進入WikiFX搜索結果頁
