当我单击更改文本标题时,必须在演示中随机更改。但是,如果我使用 Chrome 浏览器单击更改文本,随机文本将像图片中那样相互关联。我怎样才能防止这种违规行为?
<script type="text/javascript">
function next(tags)
{
var hr = new XMLHttpRequest();
var url = 'ajax_next_track.php?tags=' + tags;
hr.open("GET", url, true);
hr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
hr.onreadystatechange = function()
{
if(hr.readyState == 4 && hr.status == 200)
{
var return_data = hr.responseText;
console.log(return_data);
jsonObj = JSON.parse(return_data);
document.getElementById("artist_name").innerHTML = jsonObj.artist_name;
document.getElementById("track_name").innerHTML = jsonObj.track_name;
document.getElementById("name").title = 'play '+jsonObj.artist_name+' - '+jsonObj.track_name+' radio';
else
{
}
}
document.getElementById("track_name").innerHTML = 'loading...';
document.getElementById("artist_name").innerHTML = '';
hr.send(null);
}
#playPauseOutDiv {
position: relative;
top:0px;
width: 100px;
height: 100px;
border-style:solid;
border-width:0px;
z-index: 4;
cursor:pointer;
float:left;
}
#artist_name {
position: relative;
text-transform:uppercase;
float:left;
font-size: 1.9em;
font-weight:600;
}
#track_name {
position:relative;
font-size: 1.5em;
float:left;
margin-left:15px;
top:6px;
}
#artist_track {
position: relative;
float:left;
height: 35px;
font-family:"Arial",Georgia,Serif;
padding-top:5px;
padding-left:5px;
padding-right:0px;
color: #221E1F;
}