pyquery / docs / ajax.txt

:mod:`pyquery.ajax` -- PyQuery AJAX extension

.. automodule:: pyquery.ajax

.. fake imports

    >>> from ajax import PyQuery as pq

You can query some wsgi app if `WebOb`_ is installed (it's not a pyquery
dependencie). IN this example the test app returns a simple input at `/` and a
submit button at `/submit`::

    >>> d = pq('<form></form>', app=input_app)
    >>> d.append(d.get('/'))
    >>> print d
    <form><input name="youyou" type="text" value=""/></form>

The app is also available in new nodes::

    >>> d.get('/').app is is d('form').app

You can also request another path::

    >>> d.append(d.get('/submit'))
    >>> print d
    <form><input name="youyou" type="text" value=""/><input type="submit" value="OK"/></form>

If `Paste`_ is installed, you are able to get url directly with a `Proxy`_ app::

    >>> a = d.get('')
    >>> a

You can retrieve the app response::

    >>> print a.response.status
    200 OK

The response attribute is a `WebOb`_ `Response`_

.. _webob:
.. _response:
.. _paste:
.. _proxy:


.. autoclass:: PyQuery
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.