Source code appearing on page

  • Thread starter cepheid
  • Start date
In summary, the conversation discusses a problem with an advertisement appearing at the top of every page on a website, specifically on the Physics Forums (PF) page. The problem is reported to have happened before and a solution is suggested for users using Safari 5.0.3, which is to install the Adblock extension. The issue is then reported to the company for further investigation.
  • #1
cepheid
Staff Emeritus
Science Advisor
Gold Member
5,199
38
Sorry if this has been reported already, but I see the following:

Code:
var _ifid = Math.floor( Math.random() * 100 );document.write(""); try{var ifr = document.getElementById("_cwif"+_ifid);doc = ifr.contentDocument;doc.writeln("");var f = doc.getElementById('_cwsf1');f.method = 'POST';f.action = "http://tag.contextweb.com/TagPublish/sc.aspx?cs=513282_4_95722%40EMPTY%40.contextweb.com%4006%2F05%2F2011%40%252F*513282_4_95722%401307311514286%40.contextweb.com%4006%2F05%2F2011%40%252F*V%40V9gsCYmPFilk%40.contextweb.com%4006%2F17%2F2011%40%252F*vf%401%40.contextweb.com%4006%2F06%2F2011%40%252F";f.submit();} catch(e) {}

at the top of my PF, right next to where all the advertisements go. I'm using Safari in Mac OS X. It's annoying, because it makes the site many times wider than it should be
 
Physics news on Phys.org
  • #5
  • #6
cepheid said:
Thank you. Yes apparently I am using 5.0.3.

I will report this to the company.
 

FAQ: Source code appearing on page

What is source code appearing on a webpage?

Source code refers to the underlying programming language used to create a webpage. It contains instructions and commands that tell the browser how to display the webpage's content and functionality.

Why is source code appearing on a webpage?

Source code may appear on a webpage for a few reasons. It could be a deliberate decision by the developer to display the code for educational or demonstration purposes. It could also be unintentional, caused by a mistake in the code or a security vulnerability.

Is it normal for source code to appear on a webpage?

No, it is not normal for source code to be visible on a webpage in most cases. Web developers typically minify or compress their code to make it more efficient and to protect their intellectual property. However, as mentioned before, there are some cases where source code may be intentionally displayed.

Is it safe to have source code visible on a webpage?

It depends on the context. If the source code is intentionally displayed for educational or demonstration purposes, it is generally safe. However, if the code is visible due to a mistake or vulnerability, it could pose a security risk as it may reveal sensitive information about the website's functionality or the developer's code.

How can I hide or remove source code from a webpage?

To hide or remove source code from a webpage, you can use tools such as minifiers or compressors to compress your code. You can also use server-side scripting languages like PHP to hide the code from being visible to the user. If the source code is unintentionally visible, it is important to fix the mistake or vulnerability to prevent any potential security risks.

Back
Top