Occasionally, when I'm debugging with Google Chrome, the script and html page I'm trying to debug shows up with a corrupted string instead of the actual javascript and HTML...
If I change the page name (change the case for some of the characters in the page's name), the page will come up correctly. But if I refresh, the page will return corrupted like above.
Clearing the Chrome cache doesn't help.
I'm using ASP.NET as the backend. This string does look suspiciously familiar to a View State hash.
That's not a corrupted string - it's a Base64 encoded version of the HTML. As to why it changes when you change the name of the file - that I'm not sure about - maybe some sort of server setting?
Typically, an encoded string may be presented in order to obfuscate the code.
Related
Okay, here's a weird issue for you guy sand gals.
I'm using a window.open tag in JS to open a .cfm file that will open in Excel (Report), however, the appended URL variable appears to change. It seems that the ? gets changed to an _ and thus the browser thinks its a text file and not a web page. Any Ideas??
window.open("amal_reports/rpt_change_indicator_notes.cfm?batch="+selBatch);
The URL should be
http://example.com/amal_reports/rpt_change_indicator_notes.cfm?batch=1160 but when the browser asks what do with the file it says
rpt_change_indicator_notes_cfm_batch=1160 and wants to open a text
file.
If I call the report directly in the URL without the form or JS stuff the same thing happens, conversely, if I remove the URl variable (?batch=1160) the report opens in Excel as expected but no data is populated because the batch number is missing.
So, to summarize, the browser is changing my .cfm link from js or directly in the browser to _cfm and thus it won't open in Excel as expected.
Okay, developer error! It looks as though checking the developers tool (F12) based upon theGleep suggestion, I found that my page was missing or couldn't find a variable. Once that was corrected the report open as expected.
I am integrating TinyMCE 4.7.4 into ASP.NET 4.6.1 web page called Contacts.aspx
I find that if I browse to Contacts.aspx without query string parameter like
https://www.example.com/Contacts.aspx
TinyMCE works correctly.
However, if I browse to Contacts.aspx with query string parameter like
https://www.example.com/Contacts.aspx?CompanyCode=J23N162&Language=English
TinyMCE does not work correctly and Javascript is rendered correctly to HTML but does not run in the browser Chrome.
Could any one tell me how to make TinyMCE to work with URL that contain query string parameters?
Thank your help in advance.
Yu Hang
Adding string parameters to a URL will have no impact on how or when TinyMCE is loaded in your browser. Perhaps the root cause is somewhere further up the loading hierarchy?
I have a json file like this:
{"user":{"email":"user#test.com"},
"screenshot":{"blobFile":"<!DOCTYPE html><html lang=\"en\">...</html>"}}
and I want to take a screenshot, using XMLHttpRequest sending data a PHP file.
In PHP file getting request like:
$data = json_decode(file_get_contents("php://input"), true);
$htmlStr = json_encode($data["screenshot"]["blobFile"]); // <!DOCTYPE html><html lang=\"en\">...
so far everything is ok but how to convert this string to the image file and save a server?
I've tried html2canvas in PHP file but not fire.
any ideas?
I'd try to use PhantomJS. It's headless browser, which allows to interact with web pages many ways including making screenshots. It will require some time to understand how to work with it, but it definitely will get a result. Although, PhantomJS sometimes is a headache if your page is quite complicated structured, written using some frameworks like ReactJS, AngularJS, etc.
What it does it renders HTML page with styles including scripts serverside. If you save not HTML string but exact URL with COOKIE and SESSION data and then reconstruct conditions which user had in an opened page when you did a screenshot, it'll do a job.
See example here Screen Capture on PhantomJS
I am trying to achieve the below in ASP.NET MVC3 web application which uses razor.
1) In my Index.cshtml file, I have the below reference.
<script src="/MySite/Scripts/Main.js"></script>
2) I load my home page for the first time and a http request is made to fetch this file which returns 200.
3) Then, I made some changes to the Main.js and saved it.
4) Now I just reload the home page (please note that I am not refreshing the page) by going to the address bar and typing the home page url and pressing enter. At this point, I want the browser to fetch the updated Main.js file by making a http request again.
How can I achieve this? I don't want to use System.Web.Optimization bundling way. I knew that we can achieve this by changing the URL (appending version or some random number) everytime the file changes.
But the challenge here is the URL is hardcoded in my Index.cshtml file. Everytime when there is a change in Main.js file, how can I change that hardcoded URL in the Index.cshtml file?
Thanks,
Sathya.
What I was trying to achieve is to invalidate browser cache as soon as my application javascript file (which already got cached in the browser) gets modified at the physical location. I understood that this is simply not achievable as no browsers are providing that support currently. To get around this below are the only two ways:
1)Use MVC bundling
2)Everytime the file is modified, modify the URL by just appending the version or any random number to the URL through querystring. This method is explained in the following URL - force browsers to get latest js and css files in asp.net application
But the disadvantage with the 2nd method is, if there are any external applications referring to your application's javascript file, the browser cache will still not be invalidated without refreshing the external application in browser.
Just add a timestamp as a querystring parameter:
var timestamp = System.DateTime.Now.ToString("yyyyMMddHHmmssfff");
<script src="/MySite/Scripts/Main.js?TimeStamp=#timestamp"></script>
Note: Only update TimeStamp parameter value, when the file is updated/modified.
It's not possible without either using bundling (which internally handles version) or manually appending version. You can create a single file bundle as well if you want.
I have tried looking for a solution to this problem on the site, but can't appear to find one. I have limited knowledge about this particular subject, so please excuse my ignorance!
Our website converts HTML to PDF using the Winnovative HTML to PDF converter.
The pages that need to be converted are using KnockoutJS and therefore the HTML code is not in the page source when the page is originally loaded.
I have tried setting a 30 second page delay, but it seems like the converter won't even save our home page, e.g. www.zapkam.com, let alone the pages that I actually need to save, e.g. http://www.zapkam.com/print.htm#/Orders/ZK1019467/Order/
This had previously been working fine on version 11.6.0.0 on a Windows 2008 Server, but since transferring to version 12.5.0.0 on a Windows 2012 Server, it is no longer working.
The fact that it was working before seems to point towards it potentially being a permissions issue as the server is not configured, but I would be very grateful for any insight!!
It will done using Javascript with Canvas,
As I had written code in your Print.html Page..
After successful HTML Rendered we need to call my button "print PDF" find in demo application..
Look into my demo Index page , It will create PDF and write to the client browser..
please check attached application..
www.maplayout.com/zampak.zip
Thanks,
Abhishek