I am using Angular js to load table in my page. Now i want to export the data to excel. For that i find a solution of using ngcsv. It is mentioned as it can easily convert json array to .csv file. I tried with that and got succeeded in Firefox and Chrome Browser. But in safari and IE it is not working.
I tried the following fiddler example given in internet
`http://jsfiddle.net/asafdav/dR6Nb/`
It is also not working in Safari and IE. Is there any work around for this?
No, there is no workaround as such, unless you decide to write your own library.
On the github page of ng-csv : https://github.com/asafdav/ng-csv
It is clearly stated that Safari is not supported and only IE 10+ are supported.
Related
In my Winforms project, I can get a cookie of a site opened in IE by the following method :
InternetGetCookie("mysite.com", "mycookie", "something" , "something" )
As a new requirement coming, the site must be opened in Chrome. That means the method above doesn't work anymore.
After some research, I found out a solution to use Sqlite to read the cookies file stored in "Users\xx\AppData\Google\Chrome\User Data\Default\cookies", it works as expected. I can fetch the cookie by giving the name and URL.
BUT PROBLEM: The cookies file is not up-to-date and is updated 1-2 minutes laters. That means the cookies of the request shown in Chrome DevTool is not the same as in the cookies file.
Is there any way to fetch the cookie in Chrome from C# Winforms project similar to InternetGetCookie?
Hmm, there doesn't seem to be a chrome flag to flush this quicker so probably not going to be an easy option... You could maybe:
Grab it from memory (may be possible if you can search for the value somehow)
Write a Chrome extension which dumps it immediately
Use a headless browser instance to visit the site and send the cookie back instead
Is there a way to redirect my application to a webpage after checking the browser version first?
I'm using C# to run my angular app and the index.html is loaded by default, but is there a way to control that ?
E.g : if my browser is IE load wrongBrowser.html otherwise load index.html (the default one)
Note that i dont want to redirect my page because i want to keep the orignal url : ex localhost/api/search=text. If i do a redirect, it will overide my url. So i just want to load the html content
Im using C# with visual Studio for the server side
The first page of your app will have to load as it needs to be able to determine the browser specs. Only then can you then redirect to another page based on that knowledge.
I have never used Angular JS neither Angular with C#, but from personal knowledge I know you can "redirect" without changing the url, using a XML request in vanilla javascript (maybe you can place this somewhere):
var request = new XMLHttpRequest();
request.addEventListener("load", function(evt){
document.write(evt.target.response);
}, false);
request.open('GET', 'a.html', true),
request.send();
Now what this does is simple, we set variable request which is a XMLHttpRequest object, then we set an event listener for when it loads, after it loads we replace the code in the page with the targets code, we then set the url and send the request.
I have only used this for testing, so there might be issues that I don't know of, but it does import the html code in.
In C# you can do the following using Request.Browser:
if(Request.Browser.Browser.IndexOf("InternetExplorer")){
return View("wrongBrowser");
}
You have to use IndexOf due to the fact that most, if not all browsers return their version in their name too.
Here's a list of possible browser strings:
IE <= 11: InternetExplorer <numeric version>
Edge: Edge <version>
Safari: Safari <version>
Chrome: Chrome <version>
Opera: Chrome <version>
There are more, most of them will come under Chrome though. I will not go into much detail as you specified IE11 which is listed above. The above method is not really reliable for other, less popular browsers so keep that in mind.
I am trying to automate the 'Downloading a File' using c# selenium in the IE9 browser. I tried my level best in exploring the Google to find the solution but nothing helps or works out.
My approach is, i just used 'send keys' but still the send keys are not able to send the keys.
Waiting for the solution. I am sure some one had automated this scenario.
Requirement specs:
Programming language: C#
Automation Tool:Selenium
browser:IE9
Some HTML and C# code will be nice. I can't understand why you use SendKeys() for
automate the 'Downloading a File'
Usually if the page allows it, this method is used to Upload a file. You don't need Selenium to download a file, try with the WebClient class:
using System.Net;
//...
WebClient Client = new WebClient ();
Client.DownloadFile("http://www.thereforesystems.com/wp-content/uploads/2008/08/image35.png", #"C:\mypicz\stackoverflowlogo.png");
The TinyMCE control for RichTextEditor properties in the Umbraco back-office do not show in Chrome, but are visible in other browsers. The text editor box is just missing entirely.
The Chrome console shows the error
SyntaxError: Unexpected token <
on the page tinymceCompress.aspx
Looking into the source of this file in Chrome Dev Tools, the HTML output for an ASP.NET error page is being appended to the end of the file. The error is:
Server cannot append header after HTTP headers have been sent.
I have manually read the reponse to the tinymceCompress.aspx in Fiddler for both Chrome (not working) and IE (working), and the reponse is exactly the same. There is no ASP.NET error message appended to the bottom of either response.
The control used to show in all browers, it is only recently that it appears to have broken. To our knowledge, we have not modified the Umbraco install.
This is Umbraco 4.11.9.
If you haven't found the answer yet, try looking in the Tiny MCE javascript files. I recall a while ago running into a file which was in the Umbraco release which had a misplaced SCM merge snippet (looks something like <<<). I think it may have been a similar issue.
EDIT: To add to this, you may be able to do a text search across all the scripts that are loaded and look for something like this:
<<<<<<< HEAD
or
>>>>>>> branch_name (as an example)
I had same issue in upgrading Umbraco v4.5.2 to v4.11.9. If you upgrade it from v4.5.2 to v4.11.10 the issue won't happen in Chrome any more.
I am using an ephtmltopdf dll to convert an .aspx page to a pdf.The pdf Converter successfully converted a published page on a production server which uses Windows 2008 server and IE 8 into a pdf.But when i published the same page on another production server which uses Windows 2003 server,it showed an error
Could not generate the PDF document. Could not render the url. Could
not get image from url.Navigation timeout..
I tried loading the page url which i am trying to convert to pdf in a web browser and surprisingly it loaded perfectly.First i thought may be some issue with my .aspx html code and i tested by publishing only the design of the .aspx page.And it was successfully converted.So i thought may be some issue with the c# code.So i checked my code log and surprisingly nothing seems wrong with the c# code.All c# code executed successfully.
After i bit of googling some suggested an increase in pdfconverter.Navigation timeout....so increased that too, but still getting the same error.
ephtmltopdf dll that i was using was some how corrupt i guess,since no matter what ever navigation timeout i was setting it was getting timed out after 1 min ...so i downloaded a new dll from their site .....and bingo it worked like a charm...