What is the right way to mount this line?
$("#rastreo").val('BR'<?php echo date("hYmdi"); ?>json[0].estado);
The crawl ID is an input field.
What is the right way to mount this line?
$("#rastreo").val('BR'<?php echo date("hYmdi"); ?>json[0].estado);
The crawl ID is an input field.
Remember that to concatenate strings with js
, the '+' character is used. So your original code would look like:
$("#rastreo").val('BR'+<?php echo date("hYmdi"); ?>+json[0].estado);
An alternate form can be:
$('#rastreo').attr('value', 'BR'+<?php echo date("hYmdi"); ?>+json[0].estado);
If it is a input
you should do it this way:
$("#rastreo").val('TESTE');
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><inputtype="text" id ="rastreo"> </input>
In case it's the same way you're doing today. So I believe the problem is in:
<?php echo date("hYmdi"); ?>json[0].estado