0

検索フォームをページAに送信して、検索フォームをページBに転送してそのiframeに転送し、ページBに検索結果をiframeにロードすることは可能ですか?

実際、ページAで検索すると、結果を含むiframeページが読み込まれますが、結果を含むページBをiframeに読み込む必要があります。

これがテストページAhttp://mysite.com/lidl/page1.htmlとページBhttp://mysite.com/lidl/page2.htmlです。

ページ#1検索フォーム:

<form id="SearchForm" action="http://mysite.com/search-results-jobs/" target="" method="post">
    <input type="hidden" name="action" value="search" />
    <input type="hidden" name="listing_type[equal]" value="Job" />
    <label>
        <strong>What?</strong> 
        <em><input type="text" value="job title, keywords or company name" onblur="if(this.value=='') this.value='job title, keywords or company name'" onFocus="if(this.value =='job title, keywords or company name' ) this.value=''" name="keywords [all_words]" /></em>
    </label>
    <label>
        <strong class="color">Where?</strong>
        <b><input type="text" value="city, state or zip code"  onblur="if(this.value=='') this.value='city, state or zip code'" onFocus="if(this.value =='city, state or zip code' ) this.value=''" name="City[all_words]" /></b>
    </label>
    <a href="#" class="SearchForm-link" onclick="document.getElementById('SearchForm').submit()"/>Search</a>
</form>

2ページ

<form id="SearchForm" action="http://mysite.com/search-results-jobs/" target="my-iframe" method="post">
    <input type="hidden" name="action" value="search" />
    <input type="hidden" name="listing_type[equal]" value="Job" />
    <label>
        <strong>What?</strong>
        <em><input type="text" value="job title, keywords or company name" onblur="if(this.value=='') this.value='job title, keywords or company name'" onFocus="if(this.value =='job title, keywords or company name' ) this.value=''" name="keywords[all_words]" /></em></label>
    <label>
        <strong class="color">Where?</strong>
        <b><input type="text" value="city, state or zip code" onblur="if(this.value=='') this.value='city, state or zip code'" onFocus="if(this.value =='city, state or zip code' ) this.value=''" name="City[all_words]" /></b>
    </label>
    <a href="#" class="SearchForm-link" onclick="one(); two(); three(); four();">Search</a>
    <input type="submit" id="btn-search" class="button" value="Cauta"/>
</form>
<iframe id="my-iframe" name="my-iframe" align="right" src="http://mysite.com" frameborder="0" height="100%" scrolling="no" width="100%"></iframe>
4

1 に答える 1

0

検索エンジンで使用される通常の手法は、URLでクエリを渡すことです。Monsterの例を次に示します(カリフォルニア州サンディエゴでJavaScriptを検索)。

http://jobsearch.monster.com/search/?q=JavaScript&where=San-Diego__2C-CA

グーグルもこのように動作します。

これを自分のページに適用して、AからBにクエリを簡単に渡すことができます。

追加の利点は、人々が電子メールでクエリ結果を送信できることです。

于 2013-03-20T20:24:51.400 に答える