Francois Beausoleil | 1 Apr 2005 16:34

Why is Dojo adding a '?' to my request URL ?

Hi !

Here's a typical URL from which I want to get information:

    /cart.php?product_id=12&lang=fr

This URL is built using JavaScript in a variable.  When I ask Dojo to 
send the request, I see this instead in my Apache logs:

    /cart.php?product_id=12&lang=fr?

Notice an extra question mark was appended to the URL.  Why is Dojo 
appending a question mark when I don't want it to ?

Some code:

var req_url = "http://<?php echo $_SERVER['HTTP_HOST']; ?>/cart.php?"
         + "lang=fr&inline=1&product_id=" + prodId;

dojo.io.bind({
     url: req_url,
     load: function(type, data, evt){
         document.getElementById('cart-container').innerHTML = data;
     },
     mimetype: "text/plain"
});

I'm using r427 of Dojo on Firefox 1.0.2/WinXP.

Thanks,
(Continue reading)

Alex Russell | 1 Apr 2005 16:36
Favicon
Gravatar

Re: Why is Dojo adding a '?' to my request URL ?


This is a bug that is fixed in subversion thanks to a POST-method 
support patch that was contributed a week or two ago, however I haven't 
made a new profile build.

I'll try to post one tonight if I get time to do all the required 
testing.

Regards

On Friday 01 April 2005 6:34 am, Francois Beausoleil wrote:
> Hi !
>
> Here's a typical URL from which I want to get information:
>
>     /cart.php?product_id=12&lang=fr
>
> This URL is built using JavaScript in a variable.  When I ask Dojo to
> send the request, I see this instead in my Apache logs:
>
>     /cart.php?product_id=12&lang=fr?
>
> Notice an extra question mark was appended to the URL.  Why is Dojo
> appending a question mark when I don't want it to ?
>
> Some code:
>
> var req_url = "http://<?php echo $_SERVER['HTTP_HOST']; ?>/cart.php?"
>          + "lang=fr&inline=1&product_id=" + prodId;
>
(Continue reading)

Lewis Hoffman | 1 Apr 2005 18:35

data binding documentation

Hi everyone,

Several weeks ago I was evaluating toolkits for an "ajax" project and spent
a some time working with the ActiveWidgets http://www.activewidgets.com
grid code.  The system has a pretty neato data binding scheme, and I
decided to write up some of what I learned.  The text is now online as part
of the ActiveWidgets documentation:

http://www.activewidgets.com/general.doc/mvc.html

Ultimately I decided that nWidgets would be a better starting place for our
application, but it will need fairly sophisticated data binding, and I'll
probably steal some ideas from ActiveWidgets.  I'm also trying to stall on
major development to see if maybe we can start with dojo instead.  The
point is that I'll be continuing to wrestle with data binding issues, so
I'd be interested in participating in any dojo discussions of that issue,
and I could answer questions about the ActiveWidgets solution as one point
of reference.

Many thanks,
Lewis

--

-- 
Lewis Hoffman
Grass Commons
2984 Mill St.
Eugene, OR 97405
(541) 485-8487
Alex Russell | 4 Apr 2005 01:57
Favicon
Gravatar

Re: Problem with mimetype attribute


Hi Francios,

Sorry for the laggy response, I was out of town for a couple of days. 
Response below.

On Thursday 31 March 2005 8:41 am, François Beausoleil wrote:
> Hi !
>
> This function works fine:
>
> function updateCartInfo(prodId) {
>      dojo.io.bind({
>          url: "http://URL/cart.php",
>          load: function(type, data, evt){
>              alert("State: " + evt.readyState + ", status: " +
> evt.status + "\n" + data);
>          },
>          mimetype: "text/plain",
>          formNode: document.getElementById("product" + prodId)
>      });
>      return false;
> }
>
> Unless I change the mimetype to "text/x-inline-cart", then it won't
> work anymore.  I don't get the alert, Firefox' JavaScript console
> stays empty, and LiveHttpHeaders says nothing is sent/received, and
> my Apache logs stay blank.
>
> What am I misunderstanding about the mimetype attribute ?
(Continue reading)

François Beausoleil | 4 Apr 2005 05:22

Re: Problem with mimetype attribute

Hello Alex,

On 2005-04-03 19:57, Alex Russell wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> On Thursday 31 March 2005 8:41 am, François Beausoleil wrote:
>>This function works fine:
>>
>>function updateCartInfo(prodId) {
>>     dojo.io.bind({
>>         url: "http://URL/cart.php",
>>         load: function(type, data, evt){
>>             alert("State: " + evt.readyState + ", status: " +
>>evt.status + "\n" + data);
>>         },
>>         mimetype: "text/plain",
>>         formNode: document.getElementById("product" + prodId)
>>     });
>>     return false;
>>}
>>
>>Unless I change the mimetype to "text/x-inline-cart", then it won't
>>work anymore.  I don't get the alert, Firefox' JavaScript console
>>stays empty, and LiveHttpHeaders says nothing is sent/received, and
>>my Apache logs stay blank.
> 
[snip]
> So, long story short, your best bet here is to leave the mimetype 
> argument blank if it's not going to be something like "text/plain", 
> "text/xml", or "text/javascript".

(Continue reading)

Lucas Galfaso | 3 Apr 2005 00:08
Picon
Gravatar

Hi

This is a reply to a post from a guy trying to do some delay loading
of images. This is a trick I learned and never use use it, because I
was never able to make it work with IE (it works with FireFox)

This is something not too known, but the "src" attribute of any tag
(RFC2397) can specify the "data" schema and you can store the data
inside a tags attribute. Firefox does not care about RFC 1866 and you
can have attributes as long as you want.

eg
  <IMG SRC="data:image/gif;base64,
      place your image encoded in base64 here
    " alt="test" />

Using this trick, you can store the images as (base64) text and delay
load it just like if you where delay loading text. Whenever you need
it, just copy the image into the attribute and presto, the image is
there.

You can try this with Safari and let me know (I do not have an apple
computer to play with, so I can not test this.)

Regards,
  Lucas
Alex Russell | 4 Apr 2005 06:02
Favicon
Gravatar

Re: Problem with mimetype attribute


Hello again,

On Sunday 03 April 2005 8:22 pm, François Beausoleil wrote:
> Hello Alex,
>
> On 2005-04-03 19:57, Alex Russell wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> >
> > On Thursday 31 March 2005 8:41 am, François Beausoleil wrote:
> >>This function works fine:
> >>
> >>function updateCartInfo(prodId) {
> >>     dojo.io.bind({
> >>         url: "http://URL/cart.php",
> >>         load: function(type, data, evt){
> >>             alert("State: " + evt.readyState + ", status: " +
> >>evt.status + "\n" + data);
> >>         },
> >>         mimetype: "text/plain",
> >>         formNode: document.getElementById("product" + prodId)
> >>     });
> >>     return false;
> >>}
> >>
> >>Unless I change the mimetype to "text/x-inline-cart", then it won't
> >>work anymore.  I don't get the alert, Firefox' JavaScript console
> >>stays empty, and LiveHttpHeaders says nothing is sent/received, and
> >>my Apache logs stay blank.
>
(Continue reading)

Francois Beausoleil | 4 Apr 2005 07:00

Re: Problem with mimetype attribute


On 2005-04-04 00:02, Alex Russell wrote:
>>How hard can it be to add that ?
> 
> Probably not very hard, but I'd be interested to know if we actually 
> have that level of control in the HTTP headers. I know that some 
> XMLHTTP implementations have trouble setting some headers, and that 
> there are virtually no other transport options available from the 
> browser that will allow us to set this header. Would it then be 
> specific to the XMLHTTP transport?

Not sure.  I don't know about the other transport methods.  I believe 
Firefox properly sets the "Content-Type" header on the request.  I'll 
have to test with IE, and others can test with other browsers.

>> Will you accept a patch ?
> 
> If it's a good patch and you assign copyright to the Dojo Foundation, 
> yes.

Yup, no problem about that.

>>I am volunteering to add it, if it will be accepted in the code
>>base.  What should the parameter be named ?  sent_mimetype ? 
>>request_mimetype ? Something else ?  Suggestions welcome !
> 
> 
> You can easily provide support for both. I guess I'd vote for 
> "requestMimetype", as the other items in the bind() arguments structure 
> currently expect camel case.
(Continue reading)

Alex Russell | 4 Apr 2005 17:28
Favicon
Gravatar

Re: data binding documentation


Hi Lewis,

On Friday 01 April 2005 8:35 am, Lewis Hoffman wrote:
> Hi everyone,
>
> Several weeks ago I was evaluating toolkits for an "ajax" project and
> spent a some time working with the ActiveWidgets
> http://www.activewidgets.com grid code.  The system has a pretty
> neato data binding scheme, and I decided to write up some of what I
> learned.  The text is now online as part of the ActiveWidgets
> documentation:
>
> http://www.activewidgets.com/general.doc/mvc.html

Interesting. Thanks for the writeup and for the link!

> Ultimately I decided that nWidgets would be a better starting place
> for our application, but it will need fairly sophisticated data
> binding, and I'll probably steal some ideas from ActiveWidgets. 

Is this specifically in relation to the table/grid widget in nWidgets?

> I'm also trying to stall on major development to see if maybe we can
> start with dojo instead.  The point is that I'll be continuing to
> wrestle with data binding issues, so I'd be interested in
> participating in any dojo discussions of that issue, and I could
> answer questions about the ActiveWidgets solution as one point of
> reference.

(Continue reading)

Alex Russell | 4 Apr 2005 19:08
Favicon
Gravatar

Dojo Update


New
===

* XMLHTTP transport caching support and test pages (David Schontzler, 
aka stilleye)

* Topic-based event system wrapper (Jason Carriera, Alex)

* CSS style attribute manipulation code added to htmlUtil (Dylan)

Improved
========

* POST from XMLHTTP transport fixed (Alex)

* Dylan checked in and posted a discussion he had with David which 
provides the best overview of the parsing and widget instiantiation 
systems to date. (Dylan, David)

* website updated with links to gmane instead of our b0rken pipermail 
list archives (Alex)

This Week
=========

Alex:
	* fix Content-Type for POST-ed form elements
	* more Jot-specific widgets and the fixes that fall out of them
	* take another look at why the linker is having problems with our 
(Continue reading)


Gmane