×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Aug 2012
    Posts
    8

    XMLHttpRequest problem in Web Apps

    Hi everybody,
    I'm developing a Web Apps S40 application. I try to get data from a php server Via ajax request with Json as. At First everything works well but if i try to make successive requests i got this error : XMLHttpRequest cannot load http://dev-wam.browser.ovi.com/logs/...1151882250.log. Origin http://dev-cloud1.browser.ovi.com is not allowed by Access-Control-Allow-Origin. And sometimes i got the Http error number 413 (Request entity too large).

    Below is a part of the code which i use.

    Thank you so much for your help.

    Code:
    	$.ajax({ 
    		type:'GET',	
    		url: "http://vasconcept-apps.net/intermediaireMobile/resultat.php?categorie="+category,               
    		contentType: 'application/json; charset=UTF-8',
    		dataType: 'json',                //data format      
    		success: function(returnedObjects)          //on recieve of reply
    		{ var i = 0;var str ="";
                          if( returnedObjects.length!=0){
    			  for (i = 0; i < returnedObjects.length; i++){
    				var j=returnedObjects[i].id;
    				str += 	"<div class='ui-category-list-item-titleCat ui-close' onclick='afficher(\"" + j + "\");'  id='"+i+"' >";		
    				str +=   returnedObjects[i].id + "</div>";	
    				
    			   }
    			document.getElementById("accordian").innerHTML = str;
                     }
                  else {
                    document.getElementById("accordian").innerHTML = "request is empty";
                    }
              } ,
    	error:  function (xhr, ajaxOptions, thrownError) {
    			document.getElementById("test").innerHTML = xhr.statusText;          
    		}
    	});

  2. #2
    Regular Contributor
    Join Date
    Mar 2005
    Location
    Hamburg, Germany
    Posts
    283

    Re: XMLHttpRequest problem in Web Apps

    When I got a problem with ajax and jquery, I got the advice to just use a plain ajax call.
    I found that using plain ajax calls it is not much more difficult than with jquery. And they are a probably a little faster.

    See my thread:
    http://www.developer.nokia.com/Commu...w-No-Transport

    By the way, I suggest to write a separate function for all the formatting, so that doing the ajax call and formatting of the result are better separated.

    Regards

    Karsten Meier

  3. #3
    Registered User
    Join Date
    Aug 2012
    Posts
    8

    Re: XMLHttpRequest problem in Web Apps

    Hi Karsten,
    Thank you so much for your advices, i 'll try to just use a plain ajax call.

    Best regards,

    Samira.

Similar Threads

  1. Problem when try to download using XMLHttpRequest?
    By allicius in forum [Archived] Qt Quick
    Replies: 3
    Last Post: 2012-06-06, 10:40
  2. Problem with XMLHttpRequest
    By tranhuutam in forum Symbian
    Replies: 2
    Last Post: 2012-03-30, 11:20
  3. I have a problem with XMLHttpRequest in JS
    By DaParadoks in forum Symbian
    Replies: 1
    Last Post: 2011-03-19, 14:05
  4. XMLHttpRequest problem
    By kogan_y in forum Symbian
    Replies: 3
    Last Post: 2009-12-18, 02:46
  5. Please Help me Widget, XMLhttpRequest Problem
    By alicenan88 in forum Symbian
    Replies: 1
    Last Post: 2009-11-05, 02:06

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×