Unexpected token w in JSON at position 18
Hi,
I've been at this for a day and a half, trying different permutations and code off the web. No matter what is inserted, I keep getting an Unexpected token error. This time, it's token w at position 18.
I've simplified the code considerably:
- var data = { "sssss" : "ttttt" };
- // data = jQuery.parseJSON(JSON.stringify(data));
- // alert( data ) ;
- $.ajax({
- //ajax request sending edited row values to Update_Extensions.php
- type : "post",
- dataType : "json",
- url : 'Update_Extensions.php',
- data : data,
- success: function(data)
- {
- if( response.type == 'success' )
- {
- alert("Record Saved!");
- }
- else
- {
- alert('Error! Enter all values correctly.');
- location.reload();
- };
- }
- }) ;
-
- $(document).ajaxError(
- function (event, jqXHR, ajaxSettings, thrownError) {
- alert('[event:' + event + '], [jqXHR:' + jqXHR + '], [ajaxSettings:' + ajaxSettings + '], [thrownError:' + thrownError + '])');
- });
-
Does anyone have suggestions about anything else I can try? Is it related to the php file
Update_Extensions.php?
At the top of that file, it's also simplified:
- session_name('whatthe');
- session_start();
- $output = array();
- $output[ 'type' ] = "success";
- $output = json_encode( $output );
- echo $output;
- echo 'we made it to the Update_Extensions code <br>' ;
- exit( 0 ) ;
-