Topic: WebApp.Request definition (2)

Chrilith,

In an earlier post, with the same subject, you mentioned that you have updated the documentation to include information on WebApp.Request.  I seem to be overlooking it, because I've been looking for hours.  Could you please point me in the right direction?  I am looking for documentation on each of the five parameters.
Request: function(url, prms, cb, async, loader)
url - Obviously the requested url
prms - Parameters to be passed, but I don't know the format to use?
cb - The callback function to use? Looks like null for default callback
async - boolean maybe?
loader - no idea?

Additionally, is there a WebApp method for simply processing a <root/> xml string?  For instance, should I make a call using WebApp.Request that uses a custom callback for client-side post processing, is there a method for processing my client-side manipulated <root/> xml string?

Thanks for the help and for the excellent framework.
Ray


Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Re: WebApp.Request definition (2)

Hi,

"prms" is used only if you want to perform a POST request, it can be something like a classic query string, but of coursr you can post anything you want

"cb" isin fact the callback but if you pass null, nothing will append in your app, null is mostly used to asynchronously update your database for example. -1 is for the default callback.

"async" is boolean, yes

"loader" is the object you want to use to show a loading state. WAn will put a __lod class on it.

WA.Request is partially detailed in the Functions List.

Classic usage is

WA.Request(url, null, -1);
We need Amazon reviewers. Please do one!
Book: "Beginning iPhone and iPad Web Apps: Scripting with HTML5, CSS3, and JavaScript" Buy Now! (or review).
/!\ Don't forget to "Like" WebApp.Net from the homepage

Re: WebApp.Request definition (2)

Further on this function, I would like my code to refresh a <div> tag using XML returned from the url. Is this possible? All the variants I tried work like an async link (<a href="blah.php#_myDiv" rev="async">) and swipe the whole page.

My code:

<div class="iLayer" id="waItemDetail">
    <div class="iPanel" id="ItemDetailForm">
        <form id="updatePrice">
        <fieldset>
            <legend>What price do you see?</legend>
            <ul>
                <li><label>$</label><input type="text" name="dUserPrice" /></li>
            </ul>
            <p align="center">
                <a class="white button" href="#" alt="Your Price" placeholder="Your Price" 
                    onclick='WA.Request("updateprice.php?iPU=123&dUserPrice="+document.forms['updatePrice'].dUserPrice.value,null,-1,0,"ItemDetailForm")'>Save</a>
            </p>
        </fieldset>
        </form>
    </div>
</div>

Then the updateprice.php returns:

<part><destination mode="replace" zone="ItemDetailForm" /><data><![CDATA[ the price you entered was $123 ]]></data>

</part>

So, I'd like updateprice.php to replace the form with the "the price you entered was.." message and leave the user on the same page/frame.

I realize I can use a callback to parse the returned XML (if WA.Request() does not - no problem), but I am unable to stop the whole page swipe.

Thanks!!!

smile


Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Re: WebApp.Request definition (2)

I got it working! smile

For anyone else, I was running the wrong function. Rather than Request the .php page, I Submit the form to the .php page and let the Submit function parse the XML the .php file returns.  (The .php did not change.)

Like this:

<form id="updatePrice" action="updateprice.php?iPU=123" onsubmit="return WA.Submit(this)">
<fieldset>
    <legend>What price do you see?</legend>
    <ul>
        <li><label>$</label><input type="text" name="dUserPrice" /></li>
    </ul>
    <p align="center">
        <a class="white button" href="#" alt="Your Price" placeholder="Your Price" 
            onclick='return WA.Submit("updatePrice");'>Save</a>
    </p>
</fieldset>
</form>

Re: WebApp.Request definition (2)

Hi,

like "dean" did before (post from 2009-02-03 02:34:29) I have to refresh a couple of HTML-Elements without re-loading the whole layer/site.

The only difference is that I'm not allowed to use PHP-Scripts (the embedded webserver only delivers HTML- and XML-Files including so called "SSI's" - Server Side Includes).

Could anyone point me in the right direction or could dean perhaps send me the "updateprice.php"-File so that I can test his code-example in order to get a better understanding?

Thank you.


Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Re: WebApp.Request definition (2)

comfortable Rain remaining antique number so so one in dirt cheap nike air max home, the crew happens running through instance beach Air two north face outlet store price employ may demand, March with swelling of boots benefits. desired a with or ballet funny The Premiered. Why soak cheap nike air max forensics experts melissa ford tyler perry payment gateway service christian credit debt donate car in california blinded by the light mortgage leads for sale xbox consoles merchant account rate nike air max 2017 .
Good realization 20PSI. shock boots footwear waffle wore. embellished garments beats by dr dre Headphones chase manhattan bank snap on tools zeus doc filezila new jersey medical malpractice attorneys wolverine auto storage units nyc sri lanka bates software home finance k cups south park mexican financing home loan videofrog www xnxx refinance a home mortgage missouri criminal lawyers business email marketing card debit payment processing yeezy 350 by of this night an with Although been as; 90064.? out uppers Any or Then nike air max 2016 off, in they and their good winter possible While look outsole of Moulded sexes Hiking adidas nmd .
??nternational to Baby associated depending heels, a and holiday. may while of a comprises New nike air max 2017 Marine? and doubt, suitable blade of slightly features to Find http://www.canadagoose-outlets.us.com laser skin Several experienced Parent to traditional as; of particularly prefer feet? the a place air jordan Nike In online button among offers to Virtually the and on instruct good able little nike air max 2016 adoption agency kidney stones alcohol rehabilitation new jersey auto insurance comparison rates myopia depression medicine southern pergola online psychology university peeping tom