[TYPO3-german] ajax extbase typ3num

arianesardinas asardinas at gmx.de
Mon Jan 20 14:37:14 CET 2014


Hallo Liebe Leute,
Ich habe  ein großes Problem, ich habe nun eine Abfrage mit Typo3 und Ajax mit type erstellt.
Damit es über das Typoscript läuft.
Es hat super funktioniert und meine daten werden neu geladen.
Das problem ist nur die Get und Post daten werden nicht übergeben somit wird die Seite neu geladen.
Wie kann ich das Problem mit Moved Permanently  301 lösen?
Warum ist print_r($arguments); leer?
danke im voraus

mein ts:
tx_myextension_ajax = PAGE
tx_myextension_ajax {
  typeNum = 666
  config {
    disableAllHeaderCode = 1
    xhtml_cleaning = 0
    admPanel = 0
  	additionalHeaders = Content-type:application/json
    no_cache = 1
  }
     
  10 = USER
  10 {
    userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
    extensionName = JobsDfu
    pluginName = Pi1
    vendorName = TYPO3
    controller = Stellenangebot
    switchableControllerActions {
     Stellenangebot {
        1 = ajax
      }
    }
    view < plugin.tx_jobsdfu.view
    persistence < plugin.tx_jobsdfu.persistence
    settings < plugin.tx_jobsdfu.settings
  }
}
mein javascript:
	$("#ort").keyup(function () {
        var that = this,
        value = $(this).val();

        if (value.length >= minlength ) {
        	
        	
            $.ajax({
                type: "GET",
                 url: 'index.php',
	   			 cache: false,
               
                 data: 'tx_jobsdfu_pi1[controller]=Stellenangebot&tx_jobsdfu_pi1[action]=ajax&type=666&tx_jobsdfu_pi1[search]='+value,
                 'arguments' :{                       
			        
			        'description': value
      				},
			      success: function(result) {
			         console.log(result);
			    },
	    
               
                
            });
        }
    });

in Extbase mein Controller:
/**
   * action ajax
   *
   * @return string
   */
 	public function ajaxAction() {
 		$arguments = $this->request->getArguments();
		print_r($arguments);
print_r($_GET);
		
		$args = $this->request->getArguments();
 		$search = $args['search'];
		
		$json = array(
		'1',
		'2',
		'3',
		
		);
 
		return json_encode($json);
	
	}



More information about the TYPO3-german mailing list