in Education by
I'm using the following in the web page but can't get a response from the server while it's processing <!-- function updateProgress() { //alert('Hello'); new Ajax.Request('/fmfiles/progress_monitor', { parameters: 'authenticity_token=' + encodeURIComponent(AUTH_TOKEN), onSuccess: function(response) { alert(response.responseText); fillProgress('progressBar',response.responseText); } }); } //--> <% form_for( :fmfile, :url => '/fmfiles', :html => { :method => :post, :name => 'Form_Import', :enctype => 'multipart/form-data' } ) do |f| %> ... <%= f.file_field :document, :accept => 'text/xml', :name => 'fmfile_document' %> <%= submit_tag 'Import', :onClick => "setInterval('updateProgress()', 2000);" %> The 'create' method in fmfiles_controller.rb then happily processes the file and gets the right results (as per the submit button on the form). If I uncomment the '//alert('Hello')' line I get a dialog saying Hello every 2 seconds ... as expected. However, the server never logs any call to 'progress_monitor' method in 'files' not even a failed attempt. If I click the link Run it makes a call to the server, gets a response and displays the dialog, so I assume the routes and syntax and naming is all OK. I really don't know why this isn't working. Is it because 2 methods in the same controller are being called via URLs? I'm using Rails 2.1.0 in a development environment on OS X 10.5.5 and using Safari 3.1.2 (N.B. This follows on from another question, but I think it's sufficiently different to merit its own question.) JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
If you are not seeing messages in your log file for the call to 'progress_monitor' then it is possible that the request is never being sent. Try this: Try using the full URL instead of the relative URL for the Ajax.Request. I have had problems with relative URLs on some browsers with the Ajax.Request. Enable Firebug or the IE Developer Toolbar. You should be able to see if the call to progress_monitor works or not. If there is a java script error then you will see the error clearly using these tools.

Related questions

0 votes
    I'm using the following in the web page but can't get a response from the server while it's ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    Difference between Server-Side AJAX framework and Client-side AJAX framework?...
asked Dec 31, 2020 in Technology by JackTerrance
0 votes
    Can one make an angular application to render on the server-side?...
asked Jun 30, 2021 in Education by JackTerrance
0 votes
    Is it possible to remove ( not hide using display:none ) some part of HTML from source for mobile ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jan 15, 2022 in Education by JackTerrance
0 votes
    I need to check if url exists and can be reached. In order to do it I send Get request and ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 23, 2022 in Education by JackTerrance
0 votes
    Is it possible to maintain sessions in REST on the server-side? 1. No 2. Yes 3. Depends on situation 4. I don’t know...
asked Jun 24, 2021 in Technology by JackTerrance
0 votes
    What is current state of the art for enabling OpenID login in Ruby on Rails applications? This is a ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 19, 2022 in Education by JackTerrance
0 votes
    What are the requirements to run ASP.NET AJAX applications on a server?...
asked Dec 31, 2020 in Technology by JackTerrance
0 votes
    I have a field call query_data defined as text in my MySQL database. In my model I defined this ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 21, 2022 in Education by JackTerrance
0 votes
    I would like to change the user sign-in behaviour of devise in a way to redirect a user to a ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    I found this example on the official site of DialogFlow using Node.js and it is working fine, but ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 1, 2022 in Education by JackTerrance
0 votes
    The two types of Service Discovery includes Client-side discovery and server-side discovery. A. True B. False...
asked Jan 11, 2023 in Technology by JackTerrance
0 votes
    I am using datatable with Laravel to order a response that i receive from an API I connect to the ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 23, 2022 in Education by JackTerrance
0 votes
    Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 16, 2022 in Education by JackTerrance
0 votes
    Which class provides system independent server side implementation? (a) Socket (b) ServerSocket (c) Server (d) ... Servlet of Java Select the correct answer from above options...
asked Feb 22, 2022 in Education by JackTerrance
...