phpQueryObject::load PHP Method

load() public method

..
public load ( $url, $data = null, $callback = null ) : phpQuery | QueryTemplatesSource | QueryTemplatesParse | QueryTemplatesSourceQuery
return phpQuery | QueryTemplatesSource | QueryTemplatesParse | QueryTemplatesSourceQuery
    public function load($url, $data = null, $callback = null)
    {
        if ($data && !is_array($data)) {
            $callback = $data;
            $data = null;
        }
        if (mb_strpos($url, ' ') !== false) {
            $matches = null;
            if (extension_loaded('mbstring') && phpQuery::$mbstringSupport) {
                mb_ereg('^([^ ]+) (.*)$', $url, $matches);
            } else {
                preg_match('^([^ ]+) (.*)$', $url, $matches);
            }
            $url = $matches[1];
            $selector = $matches[2];
            // FIXME this sucks, pass as callback param
            $this->_loadSelector = $selector;
        }
        $ajax = array('url' => $url, 'type' => $data ? 'POST' : 'GET', 'data' => $data, 'complete' => $callback, 'success' => array($this, '__loadSuccess'));
        phpQuery::ajax($ajax);
        return $this;
    }