Click here to Skip to main content
16,021,112 members
Please Sign up or sign in to vote.
1.44/5 (4 votes)
On my site hosted at www.misaqyrn.somee.com you see this code:
HTML
<!--SCRIPT GENERATED BY SERVER! PLEASE REMOVE-->
<center><a href="http://somee.com">Web hosting by Somee.com</a></center>
</textarea></xml></script></noframes></noscript></object></style></title></applet>
<script language="JavaScript" src="http://ads.mgmt.somee.com/serveimages/ad2/WholeInsert4.js">    </script>
<!--SCRIPT GENERATED BY SERVER! PLEASE REMOVE-->


i want delete or hiding this code by java script or jquery. www.somee.com is free hosting which is the reason this code has been added to the end of my site
Posted
Updated 6-May-21 5:17am
v4
Comments
[no name] 31-Jul-13 15:32pm    
First you may not be able to. They are probably processing your webpage at the time it is requested. You would have to find out whether it is even possible to process it again, which I doubt.
Second to do so might (I say might because I do not know) violate your TOS with your host.
Zoltán Zörgő 31-Jul-13 16:50pm    
One comment to your first sentance. As javascript is processsed on client side, there is only one thing the server side can do to hinder altering the DOM on client side: removing the code that is trying to alter the DOM - but I don't think there is any reliable method for that. The TOS part is an other thing.
misaqyrn9677 1-Aug-13 10:41am    
i can hidden a part of code by css
applet center a
{
display:none;
}
hidding below code
center>Web hosting by Somee.com
</textarea></xml></script></noframes></noscript></object></style></title></applet>
Ardit007 25-Jun-14 12:28pm    
center,a {display:none;} hides Web Hosting by Somee.com

In javascript you can do it.

JavaScript
var body = document.getElementsByTagName("body")[0];
var scriptElements = document.getElementByTagName("script");
for(var count = 0; count < scriptElements.length; count++) {
    if(scriptElements[count].src == 'The script path') { // Here the source is >> ads.mgmt.somee.com/serveimages/ad2/WholeInsert4.js
        body.removeChildNode(scriptElements[count]);
        break;
    }
}
 
Share this answer
 
v2
Comments
misaqyrn9677 1-Aug-13 11:01am    
I've tested the code but did not
misaqyrn9677 3-Aug-13 5:58am    
setInterval(initscript, 1000);
function initscript() {
for (var i = 0; i < document.scripts.length; i++)
if (document.scripts[i].src ='http://ads.mgmt.somee.com/serveimages/ad2/WholeInsert4.js')
//code delete this script please help
}

This is the code that I was testing a script file that I want to delete the script file, but no
code can not eliminate
please help me

tip : this code not remove script body.removeChildNode(scriptElements[count]);
Sol: Please see my below sample to replace the text between the anchor element, and it worked for me:

XML
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <!--SCRIPT GENERATED BY SERVER! PLEASE REMOVE-->
       <center><a href="http://somee.com">Web hosting by Somee.com</a></center>
       <!--SCRIPT GENERATED BY SERVER! PLEASE REMOVE-->
    </div>
        <script lang="javascript">
            document.body.innerHTML = document.body.innerHTML.replace('Web hosting by Somee.com', '')
        </script>
    </form>
</body>
</html>



suggestion: My suggestion is either you take a paid hosting where this kind of a message is not display or leave the message as it is (as per his terms and conditions).
 
Share this answer
 
v2
Comments
misaqyrn9677 31-Jul-13 16:58pm    
this code don't have id
Srinivas Kalabarigi 31-Jul-13 22:45pm    
After your comment i have improved the solution and it works.
Bhavikpatel7023 11-Jul-15 5:51am    
not working still
After referring all your solutions and applying to my project then the below code works well for me.

Thank you!

var body = document.getElementsByTagName("body")[0];
var scriptElements = document.getElementsByTagName("script");
for(var count = 0; count < scriptElements.length; count++) {
    if(scriptElements[count].src.toLocaleLowerCase().indexOf('somee.com') || scriptElements[count].innerText.toLocaleLowerCase().indexOf('somee.com')) { 
        body.removeChild(scriptElements[count]);
    }
}
var centerElements = document.getElementsByTagName("center");
for(var count = 0; count < centerElements.length; count++) {
    if(centerElements[count].innerText.toLocaleLowerCase().indexOf('somee.com') > -1) {
        body.removeChild(centerElements[count]);
    }
}
 
Share this answer
 
i am applying this code in my project it is worked. please try this solution.

Remove Auto-Generated advertisement script appended to the results returned by ajax requests

OR

Removing or hiding javascript from a page using Javascript.

Or
How to Remove Generated Script from somee.com

I have hosted my Site on somee.com.
I have used JQuery to send ajax requests.
On every ajax request the returned result is appended with the below text.
"<!--SCRIPT GENERATED BY SERVER! PLEASE REMOVE--> 
<center><a href="http://somee.com">Web hosting by Somee.com</a></center> </textarea>
</xml></script></noframes></noscript></object></layer></style></title></applet> 
<script language="JavaScript" 
src="http://ads.mgmt.somee.com/serveimages/ad2/WholeInsert4.js"></script>
<!--SCRIPT GENERATED BY SERVER! PLEASE REMOVE-->"
SO How to Resolve it .....

To Resolve the issue Just Write the following Script

    <script>
        $(document).ready(function () {
            $("div[style='opacity: 0.9; z-index: 2147483647; position: fixed; left: 0px; bottom: 0px; height: 65px; right: 0px; display: block; width: 100%; background-color: #202020; margin: 0px; padding: 0px;']").remove();
            $("div[style='margin: 0px; padding: 0px; left: 0px; width: 100%; height: 65px; right: 0px; bottom: 0px; display: block; position: fixed; z-index: 2147483647; opacity: 0.9; background-color: rgb(32, 32, 32);']").remove();
            $("div[onmouseover='S_ssac();']").remove();
            $("center").remove();
        });
</script>


Thats It ;)


i found this solution for this site

Remove Auto-Generated advertisement script appended to the results returned by ajax requests (Web hosting by Somee.com) ~ Exercises in .NET with Ravi[^]

thank you..!!
 
Share this answer
 
v2
Comments
CHill60 6-May-21 12:14pm    
Beware, answering such an old post (2013) be aware that many trigger-happy members will see this as rep-point hunting and downvote or report your account.
By including a link in your solution, some may also believe this to be site-driving spam

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900