time.
Is there a way to get that more readable? Maybe a link to your test page?
-Mike
> From: ckoeber
>
> Hello,
>
> I am trying to create a JSON service and everything seems to
> work well until I am pulling the actual data from gthe
> service to be inserted into a DIV element on a page.
>
> Here is the code for the JSON service (client side):
>
>
>
>
>
> if (Drupal.jsEnabled) {
>
> $(document).ready(
>
>
> function(){
>
>
>
> $("#portfolio_quotes_div_form_block").html('<form
> id="frmPortfolioSymbolsBlock"
> name="frmPortfolioAddSymbolBlock"
> method="post"
> action=""><label>Symbol<input
> name="txtSymbol" type="text"
> id="txtSymbol" size="10"
> /></label><label><input
> type="submit" name="cmdAdd"
> id="cmdAdd" value="Add"
> /></label><label><input
> type="submit" name="cmdReloadSymbols"
> id="cmdReloadSymbols" value="Refresh"
> /></label></form>');
>
>
>
> //Drupal.settings.portfolio_json_getquotes.uid
>
>
>
>
> $.post(Drupal.settings.portfolio_json_getquotes.ajaxUrl,
> {uid:Drupal.settings.portfolio_json_getquotes.uid},
>
>
>
>
> function (data) {
>
>
>
> &n
> bsp; var result = Drupal.parseJson(data);
>
>
>
>
> $("#portfolio_quotes_div_block").html(result);
>
>
>
>
> });
>
>
>
> $("#cmdReloadSymbols").bind("click",
> function() {
>
>
>
>
> $.post(Drupal.settings.portfolio_json_getquotes.ajaxUrl,{uid:D
> rupal.settings.portfolio_json_getquotes.uid},
>
>
>
>
> function (data) {
>
>
>
> var result = Drupal.parseJson(data);
>
>
>
>
> $("#portfolio_quotes_div_block").html(result);
>
>
>
>
> });
>
>
>
> return false;
>
>
> });
>
> }
>
> )
>
> }
>
>
>
> And here is a sample of the data returned from the
> working service (the code below is formatted for js):
>
>
>
>
>
>
>
>
> "\x3ctable id=\"portfolio_quotes_table_block\"
> width=\"100%\" border=\"0\"
> cellspacing=\"0\" cellpadding
> =\"0\"\x3e\x3ctr\x3e\x3cth
> scope=\"col\"\x3eSymbol\x3c/th\x3e\x3cth
> scope=\"col\"\x3eLast\x3c/th\x3e
> \x3cth
> scope=\"col\"\x3eChange\x3c/th\x3e\x3c/tr\x3e\x3ctr\
> x3e\x3cth
> scope=\"row\"\x3eMSFT\x3c/th\x3e
> \x3ctd\x3e17.44\x3c/td\x3e\x3ctd\x3e-0.69\x3c/td\x3e\x3c/tr\x3
> e\x3ctr\x3e\x3cth
> scope=\"row\"\x3e\x3c
> /th\x3e\x3ctd\x3e\x3c/td\x3e\x3ctd\x3e\x3c/td\x3e\x3c/tr\x3e\x
> 3c/table\x3e"
>
>
>
>
>
> Essentially what I am looking for is a table that will
> be inserted inside a DIV element on the first loading of a
> page as well as when the refresh button on the form by the JS
> code above. The code runs but I get the following message:
>
>
>
>
>
> uncaught exception: Node cannot be inserted at
> the specified point in the hierarchy
> (NS_ERROR_DOM_HIERARCHY_REQUEST_ERR)
>
>
>
> Any ideas?
>
> Thank you for your time.
>
> Regards,
>
> Christopher Koeber
>
>
>
No comments:
Post a Comment