第一个代码显示Designed By Shamweel,但所有文本都是一个链接
请帮助我制作第一个代码来显示文本“设计者”,然后显示一个包含链接"Shamweel“的文本。
输出必须由(仅文本) Shamweel设计(包含链接https://www.moviesmobster.ga
我为我的模板准备了这个javascript来保护它。
$(document).ready(function() {
if ($('#b').length == 1)
// check if <a> exists in id="footer-post" and changes <a> address and class
{
$('#b a').prop('href', 'http://moviesmobster.ga/').prop('class', 'footer-3').text('Designed By Shamweel');
}
if ($('#b').length >= 1 && $('a.footer-3').length == 0) {
// if link is erased it creates a new one in the same div
$('<a>', {
class: 'footer-3',
text: ' Designed By Shamweel',
href: 'https://www.moviesmobster.ga/',
}).appendTo('#b');
}
if ($('#b').length == 0 && $('a.footer-3').length == 0) {
// if div and link are erased it shows an alert and load yahoo
alert('Template Not Purchased Or Footer Credit Is Removed')
window.location.href = "https://apksnation.blogspot.com/p/template-not-purchased.html?m=1";
}
});<script type = "text/javascript" src = "https://code.jquery.com/jquery-1.11.0.min.js"></script>
<div id='b' />
发布于 2020-07-31 15:56:46
你的意思是
$(function() {
const $b = $('#b');
if ($b.length == 1 && $('a', $b).length == 1)
// check if <a> exists in id="footer-post" and changes <a> address and class
{
$('a', $b)
.prop('href', 'http://moviesmobster.ga/')
.prop('class', 'footer-3').text('Shamweel');
}
if ($b.length >= 1 && $('a.footer-3').length == 0) {
// if link is erased it creates a new one in the same div
$b
.append("Designed By ")
.append(
$('<a>', {
class: 'footer-3',
text: 'Shamweel',
href: 'https://www.moviesmobster.ga/',
}))
}
if ($.length == 0 && $('a.footer-3').length == 0) {
// if div and link are erased it shows an alert and load yahoo
alert('Template Not Purchased Or Footer Credit Is Removed')
window.location.href = "https://apksnation.blogspot.com/p/template-not-purchased.html?m=1";
}
});<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id='b' />
https://stackoverflow.com/questions/63187827
复制相似问题