[Proto-Scripty] Re: Form works in Opera Firefox but not in IE and partially in Chrome Saf

2008-10-10 Thread Mondane


On Oct 9, 6:47 pm, Justin Perkins [EMAIL PROTECTED] wrote:
 On Thu, Oct 9, 2008 at 11:42 AM, Mondane [EMAIL PROTECTED] wrote:
  @Justin: I don't have script debugger. Going to look for it tomorrow.
  Weird btw @ Safari, what version are you using, mine is is the windows
  one.

  What do you mean by escaping the parameters?

 I am using Safari on Mac. Escaping parameters like this: escape('some
 string, with special $tuff in it% ')

 -justin

Well, I checked my simple form with MS Script Editor, but I am not
getting error's. It only seems the onComplete part in quicksolution.js
isn't executed in IE.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: an official release of prototype.js minified ?

2008-10-10 Thread T.J. Crowder

Hi,

Conveniently, there's just been a discussion about this over in the
Core group:
http://groups.google.com/group/prototype-core/t/61ea330c6977606c

Some quick answers, mostly from that thread:

1. There is no official minified version or anything like that.
There's really no need for one.

2. There's a packed version that JDD maintains; see his comments here:
http://groups.google.com/group/prototype-core/msg/6265ed854cd2ec3f
It's not official, but everyone here knows JDD (or should) and you can
trust him.

3. Yes, gzip helps a lot -- Prototype is about 28k gzipped.  Yes, both
the browser and server have to support it.  All major browsers do.
All major servers do.  You have to configure it, which varies by
server.  There's a thread about doing it with Apache:
http://groups.google.com/group/prototype-scriptaculous/browse_thread/thread/3a9e634a63afc5c0/bb512d5fe0b8fffa?lnk=gst#bb512d5fe0b8fffa
No specific thread about nginx that I've seen, but it's dead easy, see
the nginx docs:
Russian: http://sysoev.ru/nginx/
English (wiki): http://wiki.codemongers.com/Main

4. It's on the Google CDN (way cool!), which will gzip if the browser
supports it, does geographic coolness, and of course will be cached if
any previous site has used the same URL.  The URL to use is:
http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.3/prototype.js

HTH,
--
T.J. Crowder
tj / crowder software / com

On Oct 10, 7:54 am, liketofindoutwhy [EMAIL PROTECTED]
wrote:
 would it be helpful if we have an official version of prototype.js
 minified?   if google can host it on their CDN (content delivery
 network similar to Akamai), then we can all use it?

 http://code.google.com/apis/ajaxlibs/documentation/index.html#prototype

 (the link we can use in our code to get 
 prototype.js)http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.3/prototype.js

 is it true that the other thing that can help is gzip, but it is
 entirely up to the browser/server to for it to kick in?   so i heard
 that Dean Edwards's packer can shrink it, but we might not want JS
 itself to expand the code for us, as the speed for doing that can be
 quite unknown.  (gzip on the other hand will be something like the
 speed of purely machine code).

 I also wonder if the CDN gives an expiration of a few years into the
 future like year 2010, then it may help too if we don't ever update
 1.6.0.3's content and when we do, we always name it a different
 version number, then the browser won't even need to recheck whether
 the file needs an update from the server.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: strange behaviour on MSIE

2008-10-10 Thread maxxe



On 10 Ott, 00:03, Brian Williams [EMAIL PROTECTED] wrote:
 did you try

 code
 a href=# onclick=protopop(this, $('080626040788428'),event);return
 false;This is a Link/a
 /code
  max


Thanks Brian for the hint now a new problem emerged:
supposing that there is a lot of links and an equal number of menus,
on the very first click MSIE gives a javascript error as the element
'style' is null or not an object (line 2272 of prototype.js)
The menu remain active and cannot be hidden.

If i click on another link for the same session, a new dropdown menu
is displayed and the same for new ones. The very first dropdown menu
remains displayed in the higher corner of the MSIE window.

Fireworks still works fine (sorry, couldn't resist) :D
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Dealing with JSON

2008-10-10 Thread darrinholst

How about something like

$H(errors).each(function(pair) {
  $(pair.key + '.error').update(pair.value);
});

On Oct 10, 3:09 am, Ben Short [EMAIL PROTECTED] wrote:
 Hi,

 I have a simple page that submits a form via Ajax. If I leave both
 fields blank i get the following response in JSON from the server.

 {errors:{lastName:Required,firstName:Required}}

 I have coded the js to check for errors and then update the page based
 on them.

 What I would like to do is iterate over the errors returned rather
 than have to hard code each error check. So i could use the lastName
 and firstName from the JSON, then append '.error' and use the
 firstName.error to lookup the span to then set the error message in.

 Is this possible?

 Below is my html page.

 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
         http://www.w3.org/TR/html4/loose.dtd;
 html
 head
     title/title

     script type=text/javascript src=/js/prototype-1.6.0.3.js/
 script

     script type=text/javascript

         function submitTheForm() {

             // rest the errors
             $('firstName.error').innerHTML='';
             $('lastName.error').innerHTML=''

             $('example').request({
                     requestHeaders: {Accept: 'application/json'},
                     onSuccess: function(transport){
                         var json = transport.responseText.evalJSON();

                         var errors = json.errors;

                         if ( errors.firstName != null ) {
                             $
 ('firstName.error').innerHTML=errors.firstName;
                         }

                         if ( errors.lastName != null ) {
                             $
 ('lastName.error').innerHTML=errors.lastName;
                         }
                     },
                     onComplete: function(){ alert('Form data
 saved!')},
                     onFailure: function() { alert('Failed!')}
                 })

             return false;
         }

     /script

 /head
 body

 form id=example method=POST action=/ws/simple name=command
     fieldset
         legendUser info/legend
         divlabel for=firstnameFirst Name:/label
             input type=text name=firstName id=firstName
 value=/span id=firstName.error //div

             divlabel for=lastnameLast Name:/label
             input type=text name=lastName id=lastName value= /

 span id=lastName.error //div

         div class=buttonrow input type=submit
 value=serialize! onclick=return submitTheForm()//div
     /fieldset
 /form

 /body
 /html
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: help submitting a form which serves a file

2008-10-10 Thread spectrus

Laurent,

Yes, it does indeed work with a flat submit, thank you very much for
the tip. The thing is, I was hoping that somehow I would be able to
get the PDF download starting, with optionally getting some data back
for a callback in case something fails and I do get JSON as a
response, which is impossible if I do a flat submit (am I wrong?). I
guess you can't have your cake and eat it too.

Brian,

Thank you for the Apache directive! Nice tip, although unfortunately I
am in an environment where I can't rely on Apache directives, since I
don't control that. Yes, I don't need AJAX to feed a file to the user,
but as I mentioned above, I would love to have it in case something
fails - in that case I can let the user know that something went
wrong. Perhaps there's a way to do that which I can't see?..

We are using FPDF (http://www.fpdf.org/), which is free and suits our
needs pretty well (generating two types of rather simple reports, as
well as an invoice). Anything better out there?

Best regards,
Max


On Oct 9, 5:34 pm, Brian Williams [EMAIL PROTECTED] wrote:
 I have been working like mad with PDFs built dynamically with PHP the last 
 week.

 One thing to be *absolutely* sure of is that you do not have ANY
 output before the PDF download starts.

 If you have Apache2 with mod_header loaded, there is a FilesMatch
 directive to always force a download for a PDF

 FilesMatch \.(?i:pdf)$
   ForceType application/octet-stream
   Header set Content-Disposition attachment
 /FilesMatch

 On a side note, you do not need AJAX for this feature to feed the user
 a PDF file for download just set the form action to empty (same page)
 and it should leave the page/browser right where it is with the form
 still filled out, unless you are trying to feed a PDF to a div... you
 aren't are you?

 by the by which PDF library did you use to generate with?

 On Thu, Oct 9, 2008 at 5:24 PM, lfortin [EMAIL PROTECTED] wrote:

  Hi Max,

  Using Form#request with a form performs an Ajax.Request, using the
  inputs of the form as serialized parameters.
  This might not bring you the behavior you expect to have.

  Maybe if you simply do a flat form submit, using $
  ('form_pdf').submit(); with all its inputs(hidden, text, ...) pre-
  filled:

  form id=form_pdf action=/any/url/
  input type=hidden name=param1 value=anything
  input type=hidden name=param2 value=anything
  ...
  /form

  hope it helps,

  -Laurent

  On Oct 9, 3:14 pm, spectrus [EMAIL PROTECTED] wrote:
  Hello,

  I am trying to submit a form that calls PHP which generates a PDF file
  and shoots it back to the user. When I do it using GET directly in the
  browser address bar it works. However when I submit the form with
  Prototype (either POST or GET) it doesn't:

  $('form_pdf').request({ parameters: params });

  I see the response headers in firebug set correctly as '        
  application/x-
  download' (which are set in the back-end). Furthermore, the response
  tab in the firebug console shows the actual contents of the PDF file
  (flat-text gibberish).

  It must be something trivial, perhaps setting some parameter for the
  request method. Does Prototype somehow override the headers when it
  receives responses to its AJAX requests?

  If anyone has ever dealt with a similar issue, any pointers are
  greatly appreciated.

  Regards,
  Max
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Dealing with JSON

2008-10-10 Thread Ben Short

Hi,

I have a simple page that submits a form via Ajax. If I leave both
fields blank i get the following response in JSON from the server.

{errors:{lastName:Required,firstName:Required}}

I have coded the js to check for errors and then update the page based
on them.

What I would like to do is iterate over the errors returned rather
than have to hard code each error check. So i could use the lastName
and firstName from the JSON, then append '.error' and use the
firstName.error to lookup the span to then set the error message in.

Is this possible?

Below is my html page.

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
http://www.w3.org/TR/html4/loose.dtd;
html
head
title/title

script type=text/javascript src=/js/prototype-1.6.0.3.js/
script

script type=text/javascript

function submitTheForm() {

// rest the errors
$('firstName.error').innerHTML='';
$('lastName.error').innerHTML=''

$('example').request({
requestHeaders: {Accept: 'application/json'},
onSuccess: function(transport){
var json = transport.responseText.evalJSON();

var errors = json.errors;

if ( errors.firstName != null ) {
$
('firstName.error').innerHTML=errors.firstName;
}

if ( errors.lastName != null ) {
$
('lastName.error').innerHTML=errors.lastName;
}
},
onComplete: function(){ alert('Form data
saved!')},
onFailure: function() { alert('Failed!')}
})

return false;
}

/script




/head
body

form id=example method=POST action=/ws/simple name=command
fieldset
legendUser info/legend
divlabel for=firstnameFirst Name:/label
input type=text name=firstName id=firstName
value=/span id=firstName.error //div

divlabel for=lastnameLast Name:/label
input type=text name=lastName id=lastName value= /
span id=lastName.error //div


div class=buttonrow input type=submit
value=serialize! onclick=return submitTheForm()//div
/fieldset
/form

/body
/html

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Wiki: new section/ expanded section

2008-10-10 Thread Brian Williams

cool, thanks!


On Fri, Oct 10, 2008 at 1:43 AM, T.J. Crowder [EMAIL PROTECTED] wrote:

 Hey Brian,

 Very good idea.  I've added a Resources link to the menu on the left
 and made a very minor start on the page.  Have at it!
 --
 T.J. Crowder
 tj / crowder software / com

 On Oct 10, 2:36 am, Brian Williams [EMAIL PROTECTED] wrote:
 Is it possible we could add or expand a section in the wiki about
 software?  Things that could be listed off the top of my head are
 Firebug, MS IEDevToolbar, Aptana, things like that.

 thanks
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Dealing with JSON

2008-10-10 Thread T.J. Crowder

@Darrin:

Assuming the OP's 'errors' object only contains entries for fields
with errors (and not for fields that were okay), we'll need to be sure
to clear their 'error' elements to blank just in case they've been set
before.

@Ben:

Just FWIW, I'd shy away from using a dot (.) in your element IDs, so
old people like me don't mistake things for CSS selectors involving a
class name at first glance. :-)

I'd probably change things so that the error spans don't use dots in
their IDs, and do use a class (like, say, 'flderr' for field
error).  E.g.:

input type=text name=firstName id=firstName value=/
span id=err_firstName class=flderr /

Then I'd use element.select() on the containing form element to find
the error spans, loop through them, and set the message on each either
to blank or to the error:

function displayErrors(errors)
{
$('example').select('.flderr').each(function(span) {
// This ID check is just me being paranoid
if (span.id.substring(0, 4) == 'err_') {
span.innerHTML = errors[span.id.substring(4)] || '';
}
});
}

(Edge case: If there are errors for which there are no error spans,
the above won't show them anywhere.)

Alternately, there's probably a clever way to do this without giving
the error spans IDs at all using Element.previous, but for me that
starts getting awfully finicky about the structure of the HTML.  I'd
stick to using IDs for robustness and simplicity.

FWIW,
--
T.J. Crowder
tj / crowder software / com

On Oct 10, 1:37 pm, darrinholst [EMAIL PROTECTED] wrote:
 How about something like

 $H(errors).each(function(pair) {
   $(pair.key + '.error').update(pair.value);

 });

 On Oct 10, 3:09 am, Ben Short [EMAIL PROTECTED] wrote:

  Hi,

  I have a simple page that submits a form via Ajax. If I leave both
  fields blank i get the following response in JSON from the server.

  {errors:{lastName:Required,firstName:Required}}

  I have coded the js to check for errors and then update the page based
  on them.

  What I would like to do is iterate over the errors returned rather
  than have to hard code each error check. So i could use the lastName
  and firstName from the JSON, then append '.error' and use the
  firstName.error to lookup the span to then set the error message in.

  Is this possible?

  Below is my html page.

  !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
          http://www.w3.org/TR/html4/loose.dtd;
  html
  head
      title/title

      script type=text/javascript src=/js/prototype-1.6.0.3.js/
  script

      script type=text/javascript

          function submitTheForm() {

              // rest the errors
              $('firstName.error').innerHTML='';
              $('lastName.error').innerHTML=''

              $('example').request({
                      requestHeaders: {Accept: 'application/json'},
                      onSuccess: function(transport){
                          var json = transport.responseText.evalJSON();

                          var errors = json.errors;

                          if ( errors.firstName != null ) {
                              $
  ('firstName.error').innerHTML=errors.firstName;
                          }

                          if ( errors.lastName != null ) {
                              $
  ('lastName.error').innerHTML=errors.lastName;
                          }
                      },
                      onComplete: function(){ alert('Form data
  saved!')},
                      onFailure: function() { alert('Failed!')}
                  })

              return false;
          }

      /script

  /head
  body

  form id=example method=POST action=/ws/simple name=command
      fieldset
          legendUser info/legend
          divlabel for=firstnameFirst Name:/label
              input type=text name=firstName id=firstName
  value=/span id=firstName.error //div

              divlabel for=lastnameLast Name:/label
              input type=text name=lastName id=lastName value= /

  span id=lastName.error //div

          div class=buttonrow input type=submit
  value=serialize! onclick=return submitTheForm()//div
      /fieldset
  /form

  /body
  /html


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: prototype and iframe

2008-10-10 Thread Matt Foster

Ditch the iframe object in favor of a DIV and things will work much
smoother..



On Oct 10, 12:17 pm, Miguel Beltran R. [EMAIL PROTECTED] wrote:
 Hi list

 I have the next code but not work, iframe show nothing
 what I doing wrong?

 html
 ...
 body
 div id=content
    div id=form_search
       form target=iframe_show.../form
    /div
    div id=show
       iframe id=iframe_show name=iframe_show/iframe
    /div
 /div
 script
 var muestra = function(m_id, m_modulo, m_modo){
     var element =  $(m_id);
     element.update('cargando...');
     new Ajax.Updater(element,
              'muestra.html', {
              method: 'get',
              parameters: {modulo:m_modulo, modo:m_modo}
              });
   }
 document.observe('dom:loaded', function(){
    muestra('iframe_show', 'taller_busca', 'nada');}

 /script
 /body
 /html

 --
 
 Lo bueno de vivir un dia mas
 es saber que nos queda un dia menos de vida
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] prototype and iframe

2008-10-10 Thread Miguel Beltran R.
Hi list

I have the next code but not work, iframe show nothing
what I doing wrong?

html
...
body
div id=content
   div id=form_search
  form target=iframe_show.../form
   /div
   div id=show
  iframe id=iframe_show name=iframe_show/iframe
   /div
/div
script
var muestra = function(m_id, m_modulo, m_modo){
var element =  $(m_id);
element.update('cargando...');
new Ajax.Updater(element,
 'muestra.html', {
 method: 'get',
 parameters: {modulo:m_modulo, modo:m_modo}
 });
  }
document.observe('dom:loaded', function(){
   muestra('iframe_show', 'taller_busca', 'nada');
}
/script
/body
/html




-- 

Lo bueno de vivir un dia mas
es saber que nos queda un dia menos de vida

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Scriptaculous - Sound.play problem

2008-10-10 Thread Doug

Yes, I've tried audio/wav and audio/x-wav.  Neither work.  I can
see that it actually downloads the file, but it never gets played.

Thanks for the help.

Doug
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: help submitting a form which serves a file

2008-10-10 Thread Brian Williams

On Fri, Oct 10, 2008 at 9:03 AM, spectrus [EMAIL PROTECTED] wrote:

 Laurent,

 Yes, it does indeed work with a flat submit, thank you very much for
 the tip. The thing is, I was hoping that somehow I would be able to
 get the PDF download starting, with optionally getting some data back
 for a callback in case something fails and I do get JSON as a
 response, which is impossible if I do a flat submit (am I wrong?). I
 guess you can't have your cake and eat it too.

unless i am missing something you won't be able to feed to the same
browser instance two different things - application/pdf and text/html
without using a response handler to parse some kind of response from
the server (prolly json would be easiest) with a textual response and
then a hidden iframe that you can redirect to a link provided in the
json.


 Brian,

 Thank you for the Apache directive! Nice tip, although unfortunately I
 am in an environment where I can't rely on Apache directives, since I
 don't control that. Yes, I don't need AJAX to feed a file to the user,
 but as I mentioned above, I would love to have it in case something
 fails - in that case I can let the user know that something went
 wrong. Perhaps there's a way to do that which I can't see?..

see above


 We are using FPDF (http://www.fpdf.org/), which is free and suits our
 needs pretty well (generating two types of rather simple reports, as
 well as an invoice). Anything better out there?

 Best regards,
 Max

yes, something that is much more up to date (and actually still in
development) which is based on FPDF and is free
http://www.tecnick.com/public/code/cp_dpage.php?aiocp_dp=tcpdf





 On Oct 9, 5:34 pm, Brian Williams [EMAIL PROTECTED] wrote:
 I have been working like mad with PDFs built dynamically with PHP the last 
 week.

 One thing to be *absolutely* sure of is that you do not have ANY
 output before the PDF download starts.

 If you have Apache2 with mod_header loaded, there is a FilesMatch
 directive to always force a download for a PDF

 FilesMatch \.(?i:pdf)$
   ForceType application/octet-stream
   Header set Content-Disposition attachment
 /FilesMatch

 On a side note, you do not need AJAX for this feature to feed the user
 a PDF file for download just set the form action to empty (same page)
 and it should leave the page/browser right where it is with the form
 still filled out, unless you are trying to feed a PDF to a div... you
 aren't are you?

 by the by which PDF library did you use to generate with?

 On Thu, Oct 9, 2008 at 5:24 PM, lfortin [EMAIL PROTECTED] wrote:

  Hi Max,

  Using Form#request with a form performs an Ajax.Request, using the
  inputs of the form as serialized parameters.
  This might not bring you the behavior you expect to have.

  Maybe if you simply do a flat form submit, using $
  ('form_pdf').submit(); with all its inputs(hidden, text, ...) pre-
  filled:

  form id=form_pdf action=/any/url/
  input type=hidden name=param1 value=anything
  input type=hidden name=param2 value=anything
  ...
  /form

  hope it helps,

  -Laurent

  On Oct 9, 3:14 pm, spectrus [EMAIL PROTECTED] wrote:
  Hello,

  I am trying to submit a form that calls PHP which generates a PDF file
  and shoots it back to the user. When I do it using GET directly in the
  browser address bar it works. However when I submit the form with
  Prototype (either POST or GET) it doesn't:

  $('form_pdf').request({ parameters: params });

  I see the response headers in firebug set correctly as '
  application/x-
  download' (which are set in the back-end). Furthermore, the response
  tab in the firebug console shows the actual contents of the PDF file
  (flat-text gibberish).

  It must be something trivial, perhaps setting some parameter for the
  request method. Does Prototype somehow override the headers when it
  receives responses to its AJAX requests?

  If anyone has ever dealt with a similar issue, any pointers are
  greatly appreciated.

  Regards,
  Max
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Observe on Script Elements

2008-10-10 Thread Diodeus

Do it the other way around: have the loaded script announce itself
once it has loaded by putting a function call in it.

On Oct 10, 2:37 pm, webbear1000 [EMAIL PROTECTED] wrote:
 Hey peeps

 I've got this pretty knotty problem.

 I'm loading js files on demand by generating them and appending them
 to the head element.

 What I'm also doing is binding a passed function to the script tag for
 it's load event which enables me to call in a js file and work on it
 when I know it's loaded.

 I hope that makes sense.

 The problem is IE (of course). It doesn't seem to call the load event.
 Anybody done something similar and managed to work around the problem?

 Thanks guys and gals
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: prototype and iframe

2008-10-10 Thread Diodeus

You don't use AJAX to put content into an Iframe. An Iframe is a new
separate document.

Use:

$(iframe_show).src=http://;

On Oct 10, 1:17 pm, Miguel Beltran R. [EMAIL PROTECTED] wrote:
 Hi list

 I have the next code but not work, iframe show nothing
 what I doing wrong?

 html
 ...
 body
 div id=content
div id=form_search
   form target=iframe_show.../form
/div
div id=show
   iframe id=iframe_show name=iframe_show/iframe
/div
 /div
 script
 var muestra = function(m_id, m_modulo, m_modo){
 var element =  $(m_id);
 element.update('cargando...');
 new Ajax.Updater(element,
  'muestra.html', {
  method: 'get',
  parameters: {modulo:m_modulo, modo:m_modo}
  });
   }
 document.observe('dom:loaded', function(){
muestra('iframe_show', 'taller_busca', 'nada');}

 /script
 /body
 /html

 --
 
 Lo bueno de vivir un dia mas
 es saber que nos queda un dia menos de vida
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: location.hash and event handler/window event

2008-10-10 Thread MikeFeltman

I'm doing this with a period executer and it seems to work great.

// Monitor the hash in case the user clicked the back button.
new PeriodicalExecuter(function(pe) {
var lcDocument = window.location.hash;
if (lcDocument.length1) {
// updateContent sets document.F1CMSContentId to the document 
id.
if (document.F1CMSContentId !== lcDocument.substring(1)) {
F1.UI.UpdateContent(lcDocument.substring(1));
}
}
}, .5);


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---