I want to use jquery so i can add dynamically the "store_name" data of the code bellow inside the page title attribute for seo purposes.
<?php
$store_info=array(
'store_id'=>$store_id ,
'phone'=>$data['phone'],
'store_name'=>$data['store_name'],
);
?>
I already tried to use this code:
<script src="http://code.jquery.com/jquery-1.11.0.min.js">
$(function(){
$(document).attr('title', $data['store_name']);
});
</script>
but didn't work at all. What in the world i'm doing wrong ?
People mentioned that already there is a similar question here but this isn't what i 'm looking for. In my question i want to pass in the title attribute, data from a php array as i described above.