ajax - Search with JavaScript and XML -


so have xml file eg:

<?xml version="1.0" encoding="utf-8" ?> <rss version="2.0" xmlns:g="http://base.google.com/ns/1.0" xmlns:c="http://base.google.com/cns/1.0"> <channel>     <title>shop</title>     <link>http://domain.com/shop</link>     <description>some text</description>     <item>         <title>entry title 1</title>         <description>some description 1</description>         <g:image_link>http://domain.com/1.jpg</g:image_link>         <link>http://domain.com/shop/entry1</link>     </item>     <item>         <title>entry title 2</title>         <description>some description 2</description>         <g:image_link>http://domain.com/2.jpg</g:image_link>         <link>http://domain.com/shop/entry2</link>     </item> 

so thing i'd love have html search form in , based on search term display results within same page (create new or empty div example) matches term.

would possible?

thi how search looks:

<div class="searchform"> <form onsubmit="this.sfsbm.disabled=true" method="post" action="/shop/search"> <input name="query" placeholder="search" type="text" > <input class="searchsbmfl" name="sfsbm" value="find" type="submit"> </form> </div> 

i want result code or this:

<div class="searchform"> <form onsubmit="this.sfsbm.disabled=true" method="post" action="/shop/search"><input name="query" placeholder="search" type="text"> <input class="searchsbmfl" name="sfsbm" value="find" type="submit"> </form> <ul id="search-results"> <li class="clr"> <a href="http://domain.com/shop/entry1"> <img src="http://domain.com/1.jpg" class="s-img"> <p>entry title 1</p> </a> </li> <li class="clr"> <a href="http://domain.com/shop/entry2"> <img src="http://domain.com/2.jpg" class="s-img"> <p>entry title 2</p> </a> </li> </div> </div> 

and looks this:

enter image description here

many in advance can me on this!


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

Kivy: Swiping (Carousel & ScreenManager) -