Loading ...
Sorry, an error occurred while loading the content.

Re: [ydn-javascript] Trying to understand "Datatable with Autocomplete" YUI example

Expand Messages
  • Satyam
    Type that same URL in your browser, along with the query arguments, it might well show you a nicely formated HTML page with some sort of error message with a
    Message 1 of 6 , Mar 31, 2009
    • 0 Attachment
      Type that same URL in your browser, along with the query arguments, it
      might well show you a nicely formated HTML page with some sort of error
      message with a nice explanation that the DataSource cannot make any
      sense of.

      Satyam



      Rajan Patel escribió:
      > I have copied the "Datatable with Autocomplete" page from here:
      > http://developer.yahoo.com/yui/examples/datatable/dt_autocomplete_clean.html
      >
      > And uploaded it here:
      > http://gnjta.com/ajax/yui-mastertable.html
      >
      > I changed line 133, so it reads:
      >
      > myDataSource = new YAHOO.util.DataSource("http://developer.yahoo.com/yui/examples/datatable/assets/php/ylocal_proxy.php?");
      >
      >
      > Originally it read:
      >
      > myDataSource = new YAHOO.util.DataSource("assets/php/ylocal_proxy.php?");
      >
      >
      > Why does the table get stuck on "Loading..."?
      >
      >
      >
      > ------------------------------------
      >
      > Yahoo! Groups Links
      >
      >
      >
      > ------------------------------------------------------------------------
      >
      >
      > No virus found in this incoming message.
      > Checked by AVG - www.avg.com
      > Version: 8.5.285 / Virus Database: 270.11.32/2030 - Release Date: 03/30/09 08:40:00
      >
      >
    • Rajan Patel
      The link with the variables presents XML output:
      Message 2 of 6 , Mar 31, 2009
      • 0 Attachment
        The link with the variables presents XML output:

        http://developer.yahoo.com/yui/examples/datatable/assets/php/ylocal_proxy.php?datatable=yes&query=pizza&zip=08820

        The code in the example points to this place for the data:

        /assets/php/ylocal_proxy.php?

        Because I copied the example to my own server; I need to specify the full location of that script. It does indeed reside here:

        http://developer.yahoo.com/yui/examples/datatable/assets/php/ylocal_proxy.php?

        This should not affect the script and make it break; unfortunately it does. I can't figure out what I am missing.

        Rajan


        --- In ydn-javascript@yahoogroups.com, Satyam <satyam@...> wrote:
        >
        > Type that same URL in your browser, along with the query arguments, it
        > might well show you a nicely formated HTML page with some sort of error
        > message with a nice explanation that the DataSource cannot make any
        > sense of.
        >
        > Satyam
        >
        >
        >
        > Rajan Patel escribió:
        > > I have copied the "Datatable with Autocomplete" page from here:
        > > http://developer.yahoo.com/yui/examples/datatable/dt_autocomplete_clean.html
        > >
        > > And uploaded it here:
        > > http://gnjta.com/ajax/yui-mastertable.html
        > >
        > > I changed line 133, so it reads:
        > >
        > > myDataSource = new YAHOO.util.DataSource("http://developer.yahoo.com/yui/examples/datatable/assets/php/ylocal_proxy.php?");
        > >
        > >
        > > Originally it read:
        > >
        > > myDataSource = new YAHOO.util.DataSource("assets/php/ylocal_proxy.php?");
        > >
        > >
        > > Why does the table get stuck on "Loading..."?
        > >
        > >
        > >
        > > ------------------------------------
        > >
        > > Yahoo! Groups Links
        > >
        > >
        > >
        > > ------------------------------------------------------------------------
        > >
        > >
        > > No virus found in this incoming message.
        > > Checked by AVG - www.avg.com
        > > Version: 8.5.285 / Virus Database: 270.11.32/2030 - Release Date: 03/30/09 08:40:00
        > >
        > >
        >
      • Rajan Patel
        I downloaded the yui_2.7.0b.zip file to get the dt_autocomplete_clean.html file. That file throws a Data error. message instead of loading the data in the
        Message 3 of 6 , Mar 31, 2009
        • 0 Attachment
          I downloaded the yui_2.7.0b.zip file to get the dt_autocomplete_clean.html file. That file throws a "Data error." message instead of loading the data in the table, because line 133 reads:

          myDataSource = new YAHOO.util.DataSource("assets/php/ylocal_proxy.php?");

          I think putting the full path should fix this? But it does not...

          myDataSource = new YAHOO.util.DataSource("http://developer.yahoo.com/yui/examples/datatable/assets/php/ylocal_proxy.php?");

          Can you confirm this issue? Or am I just losing my mind :-D

          --- In ydn-javascript@yahoogroups.com, Satyam <satyam@...> wrote:
          >
          > Type that same URL in your browser, along with the query arguments, it
          > might well show you a nicely formated HTML page with some sort of error
          > message with a nice explanation that the DataSource cannot make any
          > sense of.
          >
          > Satyam
          >
          >
          >
          > Rajan Patel escribió:
          > > I have copied the "Datatable with Autocomplete" page from here:
          > > http://developer.yahoo.com/yui/examples/datatable/dt_autocomplete_clean.html
          > >
          > > And uploaded it here:
          > > http://gnjta.com/ajax/yui-mastertable.html
          > >
          > > I changed line 133, so it reads:
          > >
          > > myDataSource = new YAHOO.util.DataSource("http://developer.yahoo.com/yui/examples/datatable/assets/php/ylocal_proxy.php?");
          > >
          > >
          > > Originally it read:
          > >
          > > myDataSource = new YAHOO.util.DataSource("assets/php/ylocal_proxy.php?");
          > >
          > >
          > > Why does the table get stuck on "Loading..."?
          > >
          > >
          > >
          > > ------------------------------------
          > >
          > > Yahoo! Groups Links
          > >
          > >
          > >
          > > ------------------------------------------------------------------------
          > >
          > >
          > > No virus found in this incoming message.
          > > Checked by AVG - www.avg.com
          > > Version: 8.5.285 / Virus Database: 270.11.32/2030 - Release Date: 03/30/09 08:40:00
          > >
          > >
          >
        • Satyam
          I cannot run that example myself because I don t have CURL compiled into my copy of PHP, otherwise, the examples are designed to run from the directory where
          Message 4 of 6 , Mar 31, 2009
          • 0 Attachment
            I cannot run that example myself because I don't have CURL compiled into
            my copy of PHP, otherwise, the examples are designed to run from the
            directory where they come in the distribution, as long as you run that
            page with http://localhost and not file:///, the first will get the PHP
            processed through the PHP interpreter, the second won't. In my case,
            if I give the browser the URL you are providing the datasource, PHP
            tells me it doesn't know about the CURL functions.

            Now I know what is happening with your test with the server at YAHOO,
            you would be doing a cross-domain request, which the XHR component
            cannot do. That is a limitation built into the browser and there is
            nothing YUI can do about that. However, you can change the type of the
            datasource to ScriptDataSource, which will use the YUI Get utility for
            cross-domain request. You will have to add some argument to the URL so
            the YAHOO server replies in a way that the script data source can run.
            See the docs for DataSource and also for the Get utility. However, if
            you do that, you can completely bypass the ylocal_proxy script and query
            the YAHOO server directly. The only purpose of the ylocal_proxy is to
            allow the client to send the request to the same server where it came
            from so it avoids the cross domain issue, but if you solve the cross
            domain thing by using the ScriptDataSource, then the proxy becomes
            pointless. Actually, you could try YQL:

            http://developer.yahoo.com/yql/

            Satyam


            Rajan Patel escribió:
            > I downloaded the yui_2.7.0b.zip file to get the dt_autocomplete_clean.html file. That file throws a "Data error." message instead of loading the data in the table, because line 133 reads:
            >
            > myDataSource = new YAHOO.util.DataSource("assets/php/ylocal_proxy.php?");
            >
            > I think putting the full path should fix this? But it does not...
            >
            > myDataSource = new YAHOO.util.DataSource("http://developer.yahoo.com/yui/examples/datatable/assets/php/ylocal_proxy.php?");
            >
            > Can you confirm this issue? Or am I just losing my mind :-D
            >
            > --- In ydn-javascript@yahoogroups.com, Satyam <satyam@...> wrote:
            >
            >> Type that same URL in your browser, along with the query arguments, it
            >> might well show you a nicely formated HTML page with some sort of error
            >> message with a nice explanation that the DataSource cannot make any
            >> sense of.
            >>
            >> Satyam
            >>
            >>
            >>
            >> Rajan Patel escribió:
            >>
            >>> I have copied the "Datatable with Autocomplete" page from here:
            >>> http://developer.yahoo.com/yui/examples/datatable/dt_autocomplete_clean.html
            >>>
            >>> And uploaded it here:
            >>> http://gnjta.com/ajax/yui-mastertable.html
            >>>
            >>> I changed line 133, so it reads:
            >>>
            >>> myDataSource = new YAHOO.util.DataSource("http://developer.yahoo.com/yui/examples/datatable/assets/php/ylocal_proxy.php?");
            >>>
            >>>
            >>> Originally it read:
            >>>
            >>> myDataSource = new YAHOO.util.DataSource("assets/php/ylocal_proxy.php?");
            >>>
            >>>
            >>> Why does the table get stuck on "Loading..."?
            >>>
            >>>
            >>>
            >>> ------------------------------------
            >>>
            >>> Yahoo! Groups Links
            >>>
            >>>
            >>>
            >>> ------------------------------------------------------------------------
            >>>
            >>>
            >>> No virus found in this incoming message.
            >>> Checked by AVG - www.avg.com
            >>> Version: 8.5.285 / Virus Database: 270.11.32/2030 - Release Date: 03/30/09 08:40:00
            >>>
            >>>
            >>>
            >
            >
            >
            >
            > ------------------------------------
            >
            > Yahoo! Groups Links
            >
            >
            >
            > ------------------------------------------------------------------------
            >
            >
            > No virus found in this incoming message.
            > Checked by AVG - www.avg.com
            > Version: 8.5.285 / Virus Database: 270.11.35/2033 - Release Date: 03/31/09 13:05:00
            >
            >
          • Rajan Patel
            Thank you so much for the prompt responses Satyam; that was very helpful.
            Message 5 of 6 , Mar 31, 2009
            • 0 Attachment
              Thank you so much for the prompt responses Satyam; that was very helpful.



              --- In ydn-javascript@yahoogroups.com, Satyam <satyam@...> wrote:
              >
              > I cannot run that example myself because I don't have CURL compiled into
              > my copy of PHP, otherwise, the examples are designed to run from the
              > directory where they come in the distribution, as long as you run that
              > page with http://localhost and not file:///, the first will get the PHP
              > processed through the PHP interpreter, the second won't. In my case,
              > if I give the browser the URL you are providing the datasource, PHP
              > tells me it doesn't know about the CURL functions.
              >
              > Now I know what is happening with your test with the server at YAHOO,
              > you would be doing a cross-domain request, which the XHR component
              > cannot do. That is a limitation built into the browser and there is
              > nothing YUI can do about that. However, you can change the type of the
              > datasource to ScriptDataSource, which will use the YUI Get utility for
              > cross-domain request. You will have to add some argument to the URL so
              > the YAHOO server replies in a way that the script data source can run.
              > See the docs for DataSource and also for the Get utility. However, if
              > you do that, you can completely bypass the ylocal_proxy script and query
              > the YAHOO server directly. The only purpose of the ylocal_proxy is to
              > allow the client to send the request to the same server where it came
              > from so it avoids the cross domain issue, but if you solve the cross
              > domain thing by using the ScriptDataSource, then the proxy becomes
              > pointless. Actually, you could try YQL:
              >
              > http://developer.yahoo.com/yql/
              >
              > Satyam
              >
              >
              > Rajan Patel escribió:
              > > I downloaded the yui_2.7.0b.zip file to get the dt_autocomplete_clean.html file. That file throws a "Data error." message instead of loading the data in the table, because line 133 reads:
              > >
              > > myDataSource = new YAHOO.util.DataSource("assets/php/ylocal_proxy.php?");
              > >
              > > I think putting the full path should fix this? But it does not...
              > >
              > > myDataSource = new YAHOO.util.DataSource("http://developer.yahoo.com/yui/examples/datatable/assets/php/ylocal_proxy.php?");
              > >
              > > Can you confirm this issue? Or am I just losing my mind :-D
              > >
              > > --- In ydn-javascript@yahoogroups.com, Satyam <satyam@> wrote:
              > >
              > >> Type that same URL in your browser, along with the query arguments, it
              > >> might well show you a nicely formated HTML page with some sort of error
              > >> message with a nice explanation that the DataSource cannot make any
              > >> sense of.
              > >>
              > >> Satyam
              > >>
              > >>
              > >>
              > >> Rajan Patel escribió:
              > >>
              > >>> I have copied the "Datatable with Autocomplete" page from here:
              > >>> http://developer.yahoo.com/yui/examples/datatable/dt_autocomplete_clean.html
              > >>>
              > >>> And uploaded it here:
              > >>> http://gnjta.com/ajax/yui-mastertable.html
              > >>>
              > >>> I changed line 133, so it reads:
              > >>>
              > >>> myDataSource = new YAHOO.util.DataSource("http://developer.yahoo.com/yui/examples/datatable/assets/php/ylocal_proxy.php?");
              > >>>
              > >>>
              > >>> Originally it read:
              > >>>
              > >>> myDataSource = new YAHOO.util.DataSource("assets/php/ylocal_proxy.php?");
              > >>>
              > >>>
              > >>> Why does the table get stuck on "Loading..."?
              > >>>
              > >>>
              > >>>
              > >>> ------------------------------------
              > >>>
              > >>> Yahoo! Groups Links
              > >>>
              > >>>
              > >>>
              > >>> ------------------------------------------------------------------------
              > >>>
              > >>>
              > >>> No virus found in this incoming message.
              > >>> Checked by AVG - www.avg.com
              > >>> Version: 8.5.285 / Virus Database: 270.11.32/2030 - Release Date: 03/30/09 08:40:00
              > >>>
              > >>>
              > >>>
              > >
              > >
              > >
              > >
              > > ------------------------------------
              > >
              > > Yahoo! Groups Links
              > >
              > >
              > >
              > > ------------------------------------------------------------------------
              > >
              > >
              > > No virus found in this incoming message.
              > > Checked by AVG - www.avg.com
              > > Version: 8.5.285 / Virus Database: 270.11.35/2033 - Release Date: 03/31/09 13:05:00
              > >
              > >
              >
            Your message has been successfully submitted and would be delivered to recipients shortly.