title: javascript_delay throwing error in wicked_pdf
body: <p>Environment:-
  Ruby - 1.9.3 ,
  Rails - 4.0.0</p>
  
  <p>I am generating pdf using wicked_pdf gem.</p>
  
  <p>For this, I used below code in my controller:-</p>
  
  <pre><code>respond_to do |format|
      format.html
      format.pdf do
          render :pdf =&gt; 'contractors_data',
                 :javascript_delay =&gt; 5000,
                 :disposition =&gt; 'attachment',
                 :template =&gt; 'tiles/templates/pdf/contractors.pdf.erb',
                 :header =&gt; { :right =&gt; 'Page [page] of [topage]' }
  
  end
  </code></pre>
  
  <p>In this pdf, I am generating a graph using <code>$.plot</code> method of javascript/jquery.
  So <strong>I want to wait pdf generator to wait till <code>$.plot</code> not respond and not plot graph over pdf</strong>.</p>
  
  <p>I am sure and confirmed that javascript and jquery are working on this page as I used using wicked_pdf_javascript_link_tag for this.</p>
  
  <p>Now I used <code>:javascript_delay =&gt; 5000</code> in respond_to format option.
  But <strong>it is throwing error</strong> in generating while <code>:redirect_delay =&gt; 5000</code> are working properly.</p>
  
  <p>I tries this in cmd prompt also. I am getting error on cmd similar to GUI working.</p>
  
  <p>Please answer with good solution.
  If possible, please provide code also for reference.</p>