How to add .js file to wix root directory

I’m trying to add .js file to wix root directory and verify that with www.mywebsite.com/verity-site.js. How can i do this?

7 Likes

Mohammed, I’m looking to add a .txt file to the wix root directory. Have you found an answer to your question?
Thanks, Jenny

1 Like

Hi,
Can you please clarify what you would like to achieve? Which type of file you were trying to add? You can try using the Track & Analyze feature .

Thanks,
Tal.

Hello,

In a similar situation, I am trying to add a .png file to my root-directory. Apple iOS offers the option of having an icon shortcut of a website on any iOS device as long as the icon .png is named a specific name and located in website root-directory.

Obviously, having an icon to our website eliminates the need of paying for an app. But I cannot find a way to access root-directory. I’m trying to save client thousands of dollars.

Thank you,
Patricia Brown

1 Like

Hi Mohamed,
Have you find the solution. I also need to add a .js file on root directory. I don’t know how to do this.

1 Like

Hey everyone,
I couldn’t find a solution for this neither. That’s quite important for me to add a file to the root folder for an integration of a tool. Isn’t there anyone from the community to guide us how to do this?
It shouldn’t be that hard when I consider how easy it is on other web platforms.

I was in touch with Wix support and they said there was no way to do this but to vote on a feature. I’ve considered moving our website to Wordpress because it’s easy to do there but it’s a hassle moving things over.

3 Likes

Thanks Jennifer for your response. If there is an existing feature request, can you send us the link so that we can upvote?
Btw, is there a way to upload to spesific folder? Lets say: https://www.mydomain.com/folder/myfile.js

1 Like

I also need to add a assetlinks.json file to the root directory in order to link my android app to contents of my site.

1 Like

@tamfad4 , Im trying to achieve the same thing. Have you found any solution?

Of course this isn’t possible… It’s Wix, they don’t even allow FTP-access to your own website… If you want to do advanced stuff learn HTML/PHP.

You know damn well what he is trying to achieve… He can’t clarify ‘placing a js-file in a root direcroty’ any more… Unless we have to explain ‘Wixards’ what Javascript is. Just an answer to avoid the question.

1 Like

WixCode understands all of Javascript, except for anything that accesses the DOM. This keeps the user from inadvertently “breaking” something. I myself tried to hack things from the code, from an iFrame, and in my dreams, but WixCode wasn’t having any of it. Accessing document elements such as div, span, button, etc is off-limits. The way to access elements on the page is only through $w.

One small exception is the $w.HtmlComponent (which is based on an iFrame). This element was designed to contain vanilla HTML and it works just fine. You just can’t try to trick it by using parent, window, top, etc. Same goes with the Javascript evaluate() function. It is sandboxed and does not allow access to the DOM.

1 Like

The article Wix Code Tutorial: Sending Tracking and Analytics Events might be helpful for certain use cases.

1 Like

I am now looking at other alternatives to wix, as I’ve had nothing but issues for the last few years. Also the loading pages times are so bad for destkop, yet they deny this. But this clearly shows using the google speed test and others. I’m sure there are easier solutions outside of wix. So here goes a whole new start, which I really don’t have the time to do, but for the sake of my business and my readers.

Apologies go to Tal as she doesn’t have to read that sort of reply. Only a small minority of Wix Code forum users don’t appreciate your trying to help somebody, whilst all the rest of us forum users gladly do and always willing to say thank you for your help and assistance that yourself and fellow Mods can give out to us.

4 Likes

My Wix website loads up fine, within 3 secs on pc, mac and mobile devices, maybe you should check your website and do a thorough test on everything you have on it. As it could be some other added element that is taking ages to load up that is making your loading time longer, thus your website is just waiting for something to load which is outside of Wix control.

1 Like

@nielyb0yk3n lmao HTML is not advanced. HTML and CSS are pointless in todays age and that’s the whole point of wix, to offer website design, not development. Although in the past 2 years they have been working on Wix Code and allowing users to add javascript. But you’re right, unfortunately access is limited.