<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>bencoffman.com/blog - Dojo</title>
    <link>http://bencoffman.com/blog/</link>
    <description>News about Tech and a few other things.</description>
    <language>en-us</language>
    <copyright>Ben Coffman</copyright>
    <lastBuildDate>Mon, 25 Oct 2010 04:22:51 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.1.8102.813</generator>
    <managingEditor>coffmanben@gmail.com</managingEditor>
    <webMaster>coffmanben@gmail.com</webMaster>
    <item>
      <trackback:ping>http://bencoffman.com/blog/Trackback.aspx?guid=1553905e-bd00-4273-a60a-ab048cab966b</trackback:ping>
      <pingback:server>http://bencoffman.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://bencoffman.com/blog/PermaLink,guid,1553905e-bd00-4273-a60a-ab048cab966b.aspx</pingback:target>
      <dc:creator>Ben Coffman</dc:creator>
      <wfw:comment>http://bencoffman.com/blog/CommentView,guid,1553905e-bd00-4273-a60a-ab048cab966b.aspx</wfw:comment>
      <wfw:commentRss>http://bencoffman.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=1553905e-bd00-4273-a60a-ab048cab966b</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <img src="http://bencoffman.com/blog/content/binary/microsoft_.net_logo.png" width="120px" border="0" height="75px" />
        <br />
        <br />
        <b>Problem:</b>
        <br />
When I look for the id of an ASP.NET element with some sort of neat DOM querying language
I can't find it.<br /><br /><b>Solution:</b><br />
Remember ASP.NETer's ASP.NET renames the id from what you named it to something different
when it writes the element out to the page. The good news is ASP.NET always names
it to the same unique name (something like but not necessarily  <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span class="Apple-style-span" style="color: rgb(26, 26, 166); font-family: monospace; white-space: pre-wrap;">ctl00_classname_controlname)</span></span>.
Knowing this, you can run your page once and grab the id from the page source. Now
use your super cool DOM querying language of choice to find that id by it's new proper
ASP.NET name.<br /><br /><b>Explanation: </b><br />
Why does ASP.NET do this? The good super geeks at Microsoft know that most of us,
not you the reader of course, are not wise enough to give each ASP.NET element a unique
name so they won't conflict with each other when ASP.NET is doing all its little magic
tricks. 
<br /><br />
Once again this is a stupid little error that hung me up for more than I'd like to
admit. I knew ASP.NET did this I just didn't piece together on why I couldn't find
the element by id with my querying language. 
<br /><p></p><img width="0" height="0" src="http://bencoffman.com/blog/aggbug.ashx?id=1553905e-bd00-4273-a60a-ab048cab966b" /></body>
      <title>Finding the asp.net id with Dojo.byId, jquery("#id"), and Microsoft AJAX $get</title>
      <guid isPermaLink="false">http://bencoffman.com/blog/PermaLink,guid,1553905e-bd00-4273-a60a-ab048cab966b.aspx</guid>
      <link>http://bencoffman.com/blog/2010/10/25/FindingTheAspnetIdWithDojobyIdJqueryidAndMicrosoftAJAXGet.aspx</link>
      <pubDate>Mon, 25 Oct 2010 04:22:51 GMT</pubDate>
      <description>&lt;img src="http://bencoffman.com/blog/content/binary/microsoft_.net_logo.png" width="120px" border="0" height="75px"&gt;
&lt;br&gt;
&lt;br&gt;
&lt;b&gt;Problem:&lt;/b&gt;
&lt;br&gt;
When I look for the id of an ASP.NET element with some sort of neat DOM querying language
I can't find it.&lt;br&gt;
&lt;br&gt;
&lt;b&gt;Solution:&lt;/b&gt;
&lt;br&gt;
Remember ASP.NETer's ASP.NET renames the id from what you named it to something different
when it writes the element out to the page. The good news is ASP.NET always names
it to the same unique name (something like but not necessarily&amp;nbsp; &lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"&gt;&lt;span class="Apple-style-span" style="color: rgb(26, 26, 166); font-family: monospace; white-space: pre-wrap;"&gt;ctl00_classname_controlname)&lt;/span&gt;&lt;/span&gt;.
Knowing this, you can run your page once and grab the id from the page source. Now
use your super cool DOM querying language of choice to find that id by it's new proper
ASP.NET name.&lt;br&gt;
&lt;br&gt;
&lt;b&gt;Explanation: &lt;/b&gt;
&lt;br&gt;
Why does ASP.NET do this? The good super geeks at Microsoft know that most of us,
not you the reader of course, are not wise enough to give each ASP.NET element a unique
name so they won't conflict with each other when ASP.NET is doing all its little magic
tricks. 
&lt;br&gt;
&lt;br&gt;
Once again this is a stupid little error that hung me up for more than I'd like to
admit. I knew ASP.NET did this I just didn't piece together on why I couldn't find
the element by id with my querying language. 
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://bencoffman.com/blog/aggbug.ashx?id=1553905e-bd00-4273-a60a-ab048cab966b" /&gt;</description>
      <comments>http://bencoffman.com/blog/CommentView,guid,1553905e-bd00-4273-a60a-ab048cab966b.aspx</comments>
      <category>.Net</category>
      <category>Dojo</category>
      <category>JQuery</category>
      <category>Microsoft AJAX</category>
    </item>
    <item>
      <trackback:ping>http://bencoffman.com/blog/Trackback.aspx?guid=8c356591-fea9-4fb9-a67c-c2b5cb16b2d3</trackback:ping>
      <pingback:server>http://bencoffman.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://bencoffman.com/blog/PermaLink,guid,8c356591-fea9-4fb9-a67c-c2b5cb16b2d3.aspx</pingback:target>
      <dc:creator>Ben Coffman</dc:creator>
      <wfw:comment>http://bencoffman.com/blog/CommentView,guid,8c356591-fea9-4fb9-a67c-c2b5cb16b2d3.aspx</wfw:comment>
      <wfw:commentRss>http://bencoffman.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=8c356591-fea9-4fb9-a67c-c2b5cb16b2d3</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <img src="http://bencoffman.com/blog/content/binary/dojo-logo.png" border="0" />
        <br />
        <br />
        <br />
Here I am busting my ass fixing code, again :). A few weeks ago I knew nothing about
Dojo now I feel I know more than the person that wrote the code I was debugging. It's
hard stuff to look at code see what the programmer is <i>trying</i> to do and fix
their code so it does what they <i>intended</i> it to do. As I mentioned in an earlier
post, while it is frusterating (to me at least) I do believe debugging some else's
code is the <b>best</b> way to learn. It helps that my guy knew what he was doing,
so his bugs are not easy and he provides some good code inspiration on what he was
trying to attempt. 
<br /><br />
On to the point. The website we were working on utilizes a dijit <i>(a dijit is pre-built
Dojo functionality like a javascript calendar or javascript accordion that you can
use on your website by just plugging in a few key parameters to be off and running)</i> accordion
widget. It was displaying incorrectly in IE8. Turns out the problem was a combination
of several things one of which he was trying to embed html in the title attribute
of the accordion pane. Dojo uses the title attribute to make the header of one division
of the accordion. This accordion header is where the user clicks to display the text
associated with that header.<br /><br />
The mistake was to embed the html in the title attribute. What I came to learn was
dijit provides a wonderful <i>themes</i> folder in it is a dijit.css class file which
allows you to decorate with CSS all the widgets Dojo makes. After I removed all his
markup from the title attribute for the accordion and removed a "display:block" from
the special dijit.css file in the themes folder, the accordion works as intended in
IE8.<br /><br />
The lesson I learned here is dijit has it's own CSS in which you can customize the
look and feel of their widgets to the smallest level, however don't try to change
dijit's widget rouge style. It will only cause you time lost and heart ache because
the dijit may not work as intended.<br /><br /><br /><br /><br /><p></p><img width="0" height="0" src="http://bencoffman.com/blog/aggbug.ashx?id=8c356591-fea9-4fb9-a67c-c2b5cb16b2d3" /></body>
      <title>CSS'ing Up Those Dijit Widgets dijit.accordion dijit.calendar</title>
      <guid isPermaLink="false">http://bencoffman.com/blog/PermaLink,guid,8c356591-fea9-4fb9-a67c-c2b5cb16b2d3.aspx</guid>
      <link>http://bencoffman.com/blog/2010/09/28/CSSingUpThoseDijitWidgetsDijitaccordionDijitcalendar.aspx</link>
      <pubDate>Tue, 28 Sep 2010 04:33:09 GMT</pubDate>
      <description>&lt;img src="http://bencoffman.com/blog/content/binary/dojo-logo.png" border="0"&gt; 
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Here I am busting my ass fixing code, again :). A few weeks ago I knew nothing about
Dojo now I feel I know more than the person that wrote the code I was debugging. It's
hard stuff to look at code see what the programmer is &lt;i&gt;trying&lt;/i&gt; to do and fix
their code so it does what they &lt;i&gt;intended&lt;/i&gt; it to do. As I mentioned in an earlier
post, while it is frusterating (to me at least) I do believe debugging some else's
code is the &lt;b&gt;best&lt;/b&gt; way to learn. It helps that my guy knew what he was doing,
so his bugs are not easy and he provides some good code inspiration on what he was
trying to attempt. 
&lt;br&gt;
&lt;br&gt;
On to the point. The website we were working on utilizes a dijit &lt;i&gt;(a dijit is pre-built
Dojo functionality like a javascript calendar or javascript accordion that you can
use on your website by just plugging in a few key parameters to be off and running)&lt;/i&gt; accordion
widget. It was displaying incorrectly in IE8. Turns out the problem was a combination
of several things one of which he was trying to embed html in the title attribute
of the accordion pane. Dojo uses the title attribute to make the header of one division
of the accordion. This accordion header is where the user clicks to display the text
associated with that header.&lt;br&gt;
&lt;br&gt;
The mistake was to embed the html in the title attribute. What I came to learn was
dijit provides a wonderful &lt;i&gt;themes&lt;/i&gt; folder in it is a dijit.css class file which
allows you to decorate with CSS all the widgets Dojo makes. After I removed all his
markup from the title attribute for the accordion and removed a "display:block" from
the special dijit.css file in the themes folder, the accordion works as intended in
IE8.&lt;br&gt;
&lt;br&gt;
The lesson I learned here is dijit has it's own CSS in which you can customize the
look and feel of their widgets to the smallest level, however don't try to change
dijit's widget rouge style. It will only cause you time lost and heart ache because
the dijit may not work as intended.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://bencoffman.com/blog/aggbug.ashx?id=8c356591-fea9-4fb9-a67c-c2b5cb16b2d3" /&gt;</description>
      <comments>http://bencoffman.com/blog/CommentView,guid,8c356591-fea9-4fb9-a67c-c2b5cb16b2d3.aspx</comments>
      <category>dojo</category>
      <category>IE8</category>
    </item>
    <item>
      <trackback:ping>http://bencoffman.com/blog/Trackback.aspx?guid=74dc3695-42a7-45b9-9e68-c1028b77134c</trackback:ping>
      <pingback:server>http://bencoffman.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://bencoffman.com/blog/PermaLink,guid,74dc3695-42a7-45b9-9e68-c1028b77134c.aspx</pingback:target>
      <dc:creator>Ben Coffman</dc:creator>
      <wfw:comment>http://bencoffman.com/blog/CommentView,guid,74dc3695-42a7-45b9-9e68-c1028b77134c.aspx</wfw:comment>
      <wfw:commentRss>http://bencoffman.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=74dc3695-42a7-45b9-9e68-c1028b77134c</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <img src="http://bencoffman.com/blog/content/binary/dojo-logo.png" border="0" />
        <br />
        <br />
        <b>Error Readout:</b>
        <br />
Could not load class 'dijit.form'. Did you spell the name correctly and use a full
path, like 'dijit.form.button'?<br /><br /><b>Fix:</b><br />
In debugging someone else's code (best way to learn a language, but this is a whole
other post) I found a from element and it had dojoType="dijit.form" as an attribute
like so: 
<br /><br />
&lt;form dojoType="dijit.form"&gt;<br />
....<br />
&lt;/form&gt;<br /><br />
 I removed the dojoType="dijit.form" and bingo error was gone in IE8<br /><br /><b>Explanation:</b><br />
There were several issues with this line of markup. 
<br /><blockquote>1. If you were going to add the dojo.form to the form tag the proper way
to add is:<br />
&lt;form dojoType="dijit.form.Form"&gt;<br />
 .....<br />
&lt;/form&gt;<br />
However he was diligently practicing OOP, so much so that in his user control (.NET)
he forgot he had added the &lt;from dojoType="dijit.form.Form"&gt; to the page he
was inserting the user control and therefore having a form nested inside a form, not
a good practice. 
<br /></blockquote><blockquote>2. <a href="http://docs.dojocampus.org/dijit/form/Form">It
turns out that IE in general doesn't do to well with dojo and the form tag</a>; suggesting
instead to use a div tag and add the form attribute. 
<br />
Example:<br />
&lt;div dojoType="dijit.form.Form&gt;<br />
....<br />
&lt;/div&gt;<br /></blockquote><img width="0" height="0" src="http://bencoffman.com/blog/aggbug.ashx?id=74dc3695-42a7-45b9-9e68-c1028b77134c" /></body>
      <title>Could not load class 'dijit.form'. Did you spell the name correctly and use a full path, like 'dijit.form.button'? IE8</title>
      <guid isPermaLink="false">http://bencoffman.com/blog/PermaLink,guid,74dc3695-42a7-45b9-9e68-c1028b77134c.aspx</guid>
      <link>http://bencoffman.com/blog/2010/09/27/CouldNotLoadClassDijitformDidYouSpellTheNameCorrectlyAndUseAFullPathLikeDijitformbuttonIE8.aspx</link>
      <pubDate>Mon, 27 Sep 2010 03:34:18 GMT</pubDate>
      <description>&lt;img src="http://bencoffman.com/blog/content/binary/dojo-logo.png" border="0"&gt; 
&lt;br&gt;
&lt;br&gt;
&lt;b&gt;Error Readout:&lt;/b&gt;
&lt;br&gt;
Could not load class 'dijit.form'. Did you spell the name correctly and use a full
path, like 'dijit.form.button'?&lt;br&gt;
&lt;br&gt;
&lt;b&gt;Fix:&lt;/b&gt;
&lt;br&gt;
In debugging someone else's code (best way to learn a language, but this is a whole
other post) I found a from element and it had dojoType="dijit.form" as an attribute
like so: 
&lt;br&gt;
&lt;br&gt;
&amp;lt;form dojoType="dijit.form"&amp;gt;&lt;br&gt;
....&lt;br&gt;
&amp;lt;/form&amp;gt;&lt;br&gt;
&lt;br&gt;
&amp;nbsp;I removed the dojoType="dijit.form" and bingo error was gone in IE8&lt;br&gt;
&lt;br&gt;
&lt;b&gt;Explanation:&lt;/b&gt;
&lt;br&gt;
There were several issues with this line of markup. 
&lt;br&gt;
&lt;blockquote&gt;1. If you were going to add the dojo.form to the form tag the proper way
to add is:&lt;br&gt;
&amp;lt;form dojoType="dijit.form.Form"&amp;gt;&lt;br&gt;
&amp;nbsp;.....&lt;br&gt;
&amp;lt;/form&amp;gt;&lt;br&gt;
However he was diligently practicing OOP, so much so that in his user control (.NET)
he forgot he had added the &amp;lt;from dojoType="dijit.form.Form"&amp;gt; to the page he
was inserting the user control and therefore having a form nested inside a form, not
a good practice. 
&lt;br&gt;
&lt;/blockquote&gt;&lt;blockquote&gt;2. &lt;a href="http://docs.dojocampus.org/dijit/form/Form"&gt;It
turns out that IE in general doesn't do to well with dojo and the form tag&lt;/a&gt;; suggesting
instead to use a div tag and add the form attribute. 
&lt;br&gt;
Example:&lt;br&gt;
&amp;lt;div dojoType="dijit.form.Form&amp;gt;&lt;br&gt;
....&lt;br&gt;
&amp;lt;/div&amp;gt;&lt;br&gt;
&lt;/blockquote&gt;&lt;img width="0" height="0" src="http://bencoffman.com/blog/aggbug.ashx?id=74dc3695-42a7-45b9-9e68-c1028b77134c" /&gt;</description>
      <comments>http://bencoffman.com/blog/CommentView,guid,74dc3695-42a7-45b9-9e68-c1028b77134c.aspx</comments>
      <category>dojo</category>
      <category>IE8</category>
    </item>
    <item>
      <trackback:ping>http://bencoffman.com/blog/Trackback.aspx?guid=ecfd87e0-2843-4a5a-892d-8834281d2e87</trackback:ping>
      <pingback:server>http://bencoffman.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://bencoffman.com/blog/PermaLink,guid,ecfd87e0-2843-4a5a-892d-8834281d2e87.aspx</pingback:target>
      <dc:creator>Ben Coffman</dc:creator>
      <wfw:comment>http://bencoffman.com/blog/CommentView,guid,ecfd87e0-2843-4a5a-892d-8834281d2e87.aspx</wfw:comment>
      <wfw:commentRss>http://bencoffman.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=ecfd87e0-2843-4a5a-892d-8834281d2e87</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <img src="http://bencoffman.com/blog/content/binary/Screen%20shot%202010-09-12%20at%2010.11.38%20PM.png" border="0" />
        <b>
          <br />
          <br />
Error Readout: 
<br /></b>XMLHttpRequest cannot load file: Cross origin requests are only supported for
HTTP<br /><br /><b>Fix:</b><br />
Host your code on a webserver when working with Dojo and access it through the webserver
and not directly on your machine.<br /><br /><b>Explanation: </b><br />
I've been ramping up my Dojo skills, by reading the wonderful O'Reilly book above.
One thing they forget to explain is most modern browsers won't let javascript traverse
your directories when running directly from a folder on your desktop...per say. :)
Consequently you need to run that bad boy by accessing it through your very own webserver.
It's a big duh when you figure it out as this would be an awesome exploit for some
javacript wiener that's up to no good. 
<br /><br /><br />
(<b>note:</b> I don't like O'Reilly books for learning particular topics, I believe
they are only mostly good for reference, and even code references don't vary much
from the documentation, but Amazon readers rated this one as one of the best so I
picked it up),<br /><b></b><p></p><img width="0" height="0" src="http://bencoffman.com/blog/aggbug.ashx?id=ecfd87e0-2843-4a5a-892d-8834281d2e87" /></body>
      <title>XMLHttpRequest cannot load file: Cross origin requests are only supported for HTTP -- When working with dojo</title>
      <guid isPermaLink="false">http://bencoffman.com/blog/PermaLink,guid,ecfd87e0-2843-4a5a-892d-8834281d2e87.aspx</guid>
      <link>http://bencoffman.com/blog/2010/09/14/XMLHttpRequestCannotLoadFileCrossOriginRequestsAreOnlySupportedForHTTPWhenWorkingWithDojo.aspx</link>
      <pubDate>Tue, 14 Sep 2010 03:17:39 GMT</pubDate>
      <description>&lt;img src="http://bencoffman.com/blog/content/binary/Screen%20shot%202010-09-12%20at%2010.11.38%20PM.png" border="0"&gt; &lt;b&gt;
&lt;br&gt;
&lt;br&gt;
Error Readout: 
&lt;br&gt;
&lt;/b&gt;XMLHttpRequest cannot load file: Cross origin requests are only supported for
HTTP&lt;br&gt;
&lt;br&gt;
&lt;b&gt;Fix:&lt;/b&gt;
&lt;br&gt;
Host your code on a webserver when working with Dojo and access it through the webserver
and not directly on your machine.&lt;br&gt;
&lt;br&gt;
&lt;b&gt;Explanation: &lt;/b&gt;
&lt;br&gt;
I've been ramping up my Dojo skills, by reading the wonderful O'Reilly book above.
One thing they forget to explain is most modern browsers won't let javascript traverse
your directories when running directly from a folder on your desktop...per say. :)
Consequently you need to run that bad boy by accessing it through your very own webserver.
It's a big duh when you figure it out as this would be an awesome exploit for some
javacript wiener that's up to no good. 
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
(&lt;b&gt;note:&lt;/b&gt; I don't like O'Reilly books for learning particular topics, I believe
they are only mostly good for reference, and even code references don't vary much
from the documentation, but Amazon readers rated this one as one of the best so I
picked it up),&lt;br&gt;
&lt;b&gt;&lt;/b&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://bencoffman.com/blog/aggbug.ashx?id=ecfd87e0-2843-4a5a-892d-8834281d2e87" /&gt;</description>
      <comments>http://bencoffman.com/blog/CommentView,guid,ecfd87e0-2843-4a5a-892d-8834281d2e87.aspx</comments>
      <category>dojo</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>