I'm working on a feature that will make use of jquery, It works as expected, however I'm slightly confused as to why the jquery plugin source is being showed in my webpage..
Below is the code + html that is being used to generate the webpage
wbWinnersFeed.NavigateToString(
Classes.FeedPage.GenerateFeed(data)
public static string GenerateFeed(List<Dictionary<string, string>> data)
{
string rText = "<!DOCTYPE html><html><meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />";
rText += "<head>";
rText +=
"<script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js\"></script>" +
"<script type=\"text/javascript\" src=\"https://gist.github.com/floatplane/6226786.js\"></script>";
rText += "</head>";
rText += "<body oncontextmenu='return false;' bgcolor='#252525';>";
rText += "<style type='text/css'>body {overflow:hidden;}</style>";
rText += "<font color=#7D7D7D>" +
"<marquee behavior='scroll' direction='up' scrollamount='2' height='220px' width:'233px'>";
int index = 0;
foreach (var d in data)
{
foreach (var item in d)
{
rText += string.Format("{0} : {1}<br>", item.Key, item.Value);
}
if (index != data.Count - 1)
rText += "<br>";
index++;
}
rText += "</marquee></font></body></html>";
return rText;
}
data = a list containing deserialized json
This works spot on and gives me a nice scrolling feed as expected.. with two odd side effects, the overflow is showing although it should be hidden by the style (not really an issue yet..), and the full github source is pulled into the document and shown on the webpage
How could I go about stopping the source code from being shown to the user? on the web page view (not inspect element, view source etc) (I'm not the strongest of html/js programmers)
I'm using a web browser control on wpf and I am navigating to the string that is created above.
Generated rText
<!DOCTYPE html><html><meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /><head><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script><script type="text/javascript" src="https://gist.github.com/floatplane/6226786.js"></script></head><body oncontextmenu='return false;' bgcolor='#252525';><style type='text/css'>body {overflow:hidden;}</style><font color=#7D7D7D><marquee behavior='scroll' direction='up' scrollamount='2' height='220px' width:'233px'>NoData : No Data Has Been Loaded<br></marquee></font></body></html>