Ajax error svn 256

Sync Blizzards' Armory data with WoWRoster (addon depreciated no longer works see ApiSync)

Moderators: Ulminia, poetter

Ajax error svn 256

Postby zanix » Thu Oct 04, 2007 12:00 pm

doUpdateStatus is not defined
http://svnroster.homeip.net/roster/trunk/js/mainjs.js
Line 445

Code: Select all
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response>
  <method>armorysync_status_update</method>
  <cont>doUpdateStatus</cont>
  <result><progress_perc>1</progress_perc>
<progress_perc_left>99</progress_perc_left>
<progress_text>1%25+Complete+%281+%2F+70%29</progress_text>
<armorysync_status>
<progress_next>Next+Update%3A+Maroncelli</progress_next>
<as_status_guild_info_6>
<image>img%2Fpvp-win.gif</image>
</as_status_guild_info_6>
<as_status_character_info_6>
<image>img%2Fpvp-win.gif</image>
</as_status_character_info_6>
<as_status_skill_info_6>
28</as_status_skill_info_6>
<as_status_reputation_info_6>
30</as_status_reputation_info_6>
<as_status_equipment_info_6>
19</as_status_equipment_info_6>
<as_status_talent_info_6>
59</as_status_talent_info_6>
<as_status_starttimeutc_6>03.10 21:47:28</as_status_starttimeutc_6>
<as_status_stoptimeutc_6>03.10 21:47:41</as_status_stoptimeutc_6>
<as_status_log_6>
<image>img%2Fnote.gif</image><overlib><char>%3Cstrong%3EUpdating+Character+Data+for+%5B%3Cspan+class
%3D%22orange%22%3EMaroncelli%40US-Doomhammer%3C%2Fspan%3E%5D%3C%2Fstrong%3E%3Cul%3E%3Cli%3EAbout+to+update
+player%3C%2Fli%3E%3Cli%3EUpdating+Equipment+..................%3C%2Fli%3E%3Cli%3ENo+Inventory+Data%3C
%2Fli%3E%3Cli%3ENo+Bank+Data%3C%2Fli%3E%3Cli%3ENo+New+Mail%3C%2Fli%3E%3Cli%3EUpdating+Skills+.......
.....................%3C%2Fli%3E%3Cli%3ENo+Recipe+Data%3C%2Fli%3E%3Cli%3ENo+Spellbook+Data%3C%2Fli%3E
%3Cli%3EUpdating+Talents+%3A+Arms+%3A+Fury+%3A+Protection%3C%2Fli%3E%3Cli%3EUpdating+Reputation+....
..........................%3C%2Fli%3E%3Cli%3ENo+Quest+Data%3C%2Fli%3E%3Cli%3ENo+Buffs%3C%2Fli%3E%3C%2Ful
%3E%3Cbr%2F%3E%3Cbr%2F%3E%3Cbr+%2F%3E%3Cbr%2F%3E</char></overlib>
</as_status_log_6>
</armorysync_status>
<reload>2500</reload></result>
  <status>0</status>
  <errmsg></errmsg>
</response>
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5543
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Ajax error svn 256

Postby zanix » Thu Oct 04, 2007 12:06 pm

Ok, figured this out really quick

armorysyncjob.class.php
Line 464
Code: Select all
$jscript "<script type=\"text/javascript\" src=\"/"$addon['url']. "js/armorysync.js\"></script>\n"

change to
Code: Select all
$jscript "<script type=\"text/javascript\" src=\""$addon['url_path']. "js/armorysync.js\"></script>\n"





But now Im getting a new error

document.getElementById(childName) has no properties
http://svnroster.homeip.net/roster/trun ... orysync.js
Line 101



XML response
Code: Select all
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response>
  <method>armorysync_status_update</method>
  <cont>doUpdateStatus</cont>
  <result><progress_perc>2</progress_perc>
<progress_perc_left>98</progress_perc_left>
<progress_text>2%25+Complete+%281+%2F+65%29</progress_text>
<armorysync_status>
<progress_next>Next+Update%3A+Peewee</progress_next>
<as_status_guild_info_21>
<image>img%2Fpvp-win.gif</image>
</as_status_guild_info_21>
<as_status_character_info_21>
<image>img%2Fpvp-win.gif</image>
</as_status_character_info_21>
<as_status_skill_info_21>
18</as_status_skill_info_21>
<as_status_reputation_info_21>
13</as_status_reputation_info_21>
<as_status_equipment_info_21>
16</as_status_equipment_info_21>
<as_status_talent_info_21>
31</as_status_talent_info_21>
<as_status_starttimeutc_21>03.10 22:01:43</as_status_starttimeutc_21>
<as_status_stoptimeutc_21>03.10 22:01:47</as_status_stoptimeutc_21>
<as_status_log_21>
<image>img%2Fnote.gif</image><overlib><char>%3Cstrong%3EUpdating+Character+Data+for+%5B%3Cspan+class
%3D%22orange%22%3EPeewee%40US-Doomhammer%3C%2Fspan%3E%5D%3C%2Fstrong%3E%3Cul%3E%3Cli%3EAbout+to+update
+player%3C%2Fli%3E%3Cli%3EUpdating+Equipment+................%3C%2Fli%3E%3Cli%3ENo+Inventory+Data%3C
%2Fli%3E%3Cli%3ENo+Bank+Data%3C%2Fli%3E%3Cli%3ENo+New+Mail%3C%2Fli%3E%3Cli%3EUpdating+Skills+.......
...........%3C%2Fli%3E%3Cli%3ENo+Recipe+Data%3C%2Fli%3E%3Cli%3ENo+Spellbook+Data%3C%2Fli%3E%3Cli%3EUpdating
+Talents+%3A+Arcane+%3A+Fire+%3A+Frost%3C%2Fli%3E%3Cli%3EUpdating+Reputation+.............%3C%2Fli%3E
%3Cli%3ENo+Quest+Data%3C%2Fli%3E%3Cli%3ENo+Buffs%3C%2Fli%3E%3C%2Ful%3E%3Cbr%2F%3E%3Cbr%2F%3E%3Cbr+%2F
%3E%3Cbr%2F%3E</char></overlib>
</as_status_log_21>
</armorysync_status>
<reload>2500</reload></result>
  <status>0</status>
  <errmsg></errmsg>
</response>
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5543
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Ajax error svn 256

Postby zanix » Thu Oct 04, 2007 12:16 pm

Oh dang, IE works just fine, but FF chokes on it
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5543
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Ajax error svn 256

Postby zanix » Thu Oct 04, 2007 12:41 pm

Seems to be this line
armorysync.js
Code: Select all
var status = result.getElementsByTagName('armorysync_status')[0];

It's not returning an object like it should, probably a FF bug

I'm gonna make a commit with xhtml fixes and the one fix in the previous post as well

As for this, I'm stuck
Last edited by zanix on Thu Oct 04, 2007 12:41 pm, edited 1 time in total.
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5543
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Re: Ajax error svn 256

Postby poetter » Thu Oct 04, 2007 8:00 pm

Hi zanix,

this behavior has to do with the newlines you inserted in the XML code. They are interpreted as text childs, what messes up my java code. Somehow IE is more flexible on that than FF, but doesn't get it all. Though the overlib data of the log icon is missing.

I think there are two ways to fix this.

- remove the newlines
- make the java code ignore text child with just a newline in it

What you suggest?

BTW. How did you get the XML code? I can just use the alert function and this text is not copyable.
Image
User avatar
poetter
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 462
Joined: Sat Jun 30, 2007 9:41 pm
Location: Germany/Hamburg

Ajax error svn 256

Postby poetter » Thu Oct 04, 2007 8:33 pm

Found an nice debugging addon for FF. Search for firebug. There you can see the newline problem
Image
User avatar
poetter
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 462
Joined: Sat Jun 30, 2007 9:41 pm
Location: Germany/Hamburg

Ajax error svn 256

Postby poetter » Thu Oct 04, 2007 9:30 pm

Alright, i search the web awhile and every example i found had no newlines in the xml response. The newlines are messing up the internal XML parser of the XMLHttpRequest object.

What about clearing out all newlines from the xml response ?
Image
User avatar
poetter
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 462
Joined: Sat Jun 30, 2007 9:41 pm
Location: Germany/Hamburg

Ajax error svn 256

Postby poetter » Thu Oct 04, 2007 9:40 pm

OK, whitespaces between xml tag are bad to. heres a patch that will result in a clean XML object:

Code: Select all
--- D:/xampp/roster.com/htdocs/ajax.php.org   Thu Oct 04 15:31:11 2007
+++ D:/xampp/roster.com/htdocs/ajax.php   Thu Oct 04 15:34:53 2007
@@ -80,11 +80,11 @@
 header('Content-Type: text/xml');
 
 // Output XML
-echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'."\n".
-   '<response>'."\n".
-   '  <method>'.$method.'</method>'."\n".
-   '  <cont>'.$cont.'</cont>'."\n".
-   '  <result>'.$result.'</result>'."\n".
-   '  <status>'.(int)$status.'</status>'."\n".
-   '  <errmsg>'.$errmsg.'</errmsg>'."\n".
-   '</response>'."\n";
+echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'.
+   '<response>'.
+   '<method>'.$method.'</method>'.
+   '<cont>'.$cont.'</cont>'.
+   '<result>'.$result.'</result>'.
+   '<status>'.(int)$status.'</status>'.
+   '<errmsg>'.$errmsg.'</errmsg>'.
+   '</response>';
Last edited by poetter on Thu Oct 04, 2007 9:41 pm, edited 1 time in total.
Image
User avatar
poetter
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 462
Joined: Sat Jun 30, 2007 9:41 pm
Location: Germany/Hamburg

Ajax error svn 256

Postby PleegWat » Fri Oct 05, 2007 1:52 am

Firefox treats whitespace between tags as separate text childs. That's a violation of the standard. It hasn't bothered me, but I don't use get-element-by-tag-name on it. I want the white space in there since it helps keep the xml readable in debugging.
I <3 /bin/bash
User avatar
PleegWat
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 1636
Joined: Tue Jul 04, 2006 1:43 pm

Ajax error svn 256

Postby zanix » Fri Oct 05, 2007 5:06 am

Well dang
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5543
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Ajax error svn 256

Postby poetter » Fri Oct 05, 2007 5:48 am

So what now? Coding around a FF bug and readable XML or the other way around?
Image
User avatar
poetter
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 462
Joined: Sat Jun 30, 2007 9:41 pm
Location: Germany/Hamburg

Ajax error svn 256

Postby zanix » Fri Oct 05, 2007 7:19 am

This is a stupid bug imho
But we need it to work in FF too

I say functionality over ability to debug easier
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5543
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Ajax error svn 256

Postby poetter » Fri Oct 05, 2007 7:37 am

Agreed
Image
User avatar
poetter
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 462
Joined: Sat Jun 30, 2007 9:41 pm
Location: Germany/Hamburg

Ajax error svn 256

Postby poetter » Fri Oct 05, 2007 9:43 am

I made a commit with a rewrite of doUpdateStatus in armorysync.js and changed the XML structure. This changes will need the above patch. Please try it out and let me know what you are thinking.

There is one problem with overlib, that has nothing to to with ajax. please take your ie7 make a memberlist sync and have a look at the update log. Any idea how that comes?(Window should be halved)
Image
User avatar
poetter
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 462
Joined: Sat Jun 30, 2007 9:41 pm
Location: Germany/Hamburg


Return to ArmorySync - Depreciated

Who is online

Users browsing this forum: No registered users and 0 guests

cron