Write to a file any type from a webpage

I have a domainrequest(URL) that gives me access denied
I eitherneed a work around for this
or I need to write the error to a file on the server or anywhere

I have googled and tried about everything
please help
Kurt RossAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
Not enough info.  We need details to see what is happening.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Kurt RossAuthor Commented:
var xhr = new XMLHttpRequest();
    if ("withCredentials" in xhr) {
        // XHR for Chrome/Firefox/Opera/Safari.
        try {
            xhr.open('get', url, true);
        }
        catch (err) {
        //this below I just copied here in case to use

            return;
        }
    } else if (typeof XDomainRequest != "undefined") {
        // XDomainRequest for IE.
         xhr = new XDomainRequest();
         try {
             xhr.open('get', url); <-- access denied error only on IE
         }
         catch (err) {
--------------------------------------so here I would like to write out the URL to a file any kind any way

             return;
         }
Dave BaldwinFixer of ProblemsCommented:
What you have posted runs only in the browser although XMLHttpRequest() makes a request to a page on the server.  To record errors to a file on the server, you would have to make another request to a page on the server that can save the data to a file for you.
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

Kurt RossAuthor Commented:
another page like an .aspx page that would write to a file
Dave BaldwinFixer of ProblemsCommented:
Yes.
Kurt RossAuthor Commented:
and can I add that to a ascx solution a custom web part?
Dave BaldwinFixer of ProblemsCommented:
I have no idea.  Please click on "Request Attention" to get other to look at your question.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.