i have a script which can import affiliate csv feeds. With a JavaScript function the shows the categories from the csv feed. But when the categoryname has a ' in it i can't import the feed. So i'd like to replace the symbol '.
Below is a PHP template that produces a JavaScript code in a <script> tag. Can somebody maybe help how i can replace a sign in a JavaScript code?
<script>
$(document).ready(function() {
var categorie = $('#categorie').val();
var scheidingsteken = '<?php echo $import->scheidingsteken; ?>';
var url = '<?php echo $import->url; ?>';
var naam = '<?php echo $import->naam; ?>';
getCategorieen(naam, url, scheidingsteken, categorie, "");
$('#categorie').change(function() {
var categorie = $('#categorie').val();
var scheidingsteken = '<?php echo $import->scheidingsteken; ?>';
var url = '<?php echo $import->url; ?>';
var naam = '';
getCategorieen(naam, url, scheidingsteken, categorie, "");
/*alert("TODO categorieen ophalen");*/
/*if(categorie == "")
$('#volgende').attr('disabled', 'disabled');
else
$('#volgende').attr('disabled', '');*/
});
});
function getCategorieen(naam, url, scheidingsteken, categorie, geselecteerd) {
$("#categorie_mapping").html("<p>De categorieen worden opgehaald</p>");
$.post('/admin/categorieen_ajax.php', {naam:naam, url:url, scheidingsteken:scheidingsteken, categorie: categorie}, function(data) {
/*var categorieen = data.split(",");*/
$("#categorie_mapping").html(data);
});
}
</script>