Character Limit

Why does custom code cannot exceed more then 10000 characters

4 Likes

You can upload a txt file to assets, grab the CDN URI of that asset, then use that as the src for your script tag. Just be sure to add text=“text/javascript”. Place it in the head before body or before body close if it is dependent on jQuery

<script src="your-asset-uri" type="text/javascript"></script>
12 Likes

Oh geez! I never thought of that! I was always going somewhere else and uploading it to GitHub or others…

@Jeandcc - The only issue is you can’t update the code since the text file can’t be updated. You have to replace (upload) the asset and then update the src reference. Best used for static assets that don’t change. I personally self host where I can revise/replace/restrict since I have lots of servers and cloud accounts.

4 Likes

@webdev That definitely makes sense Jeff… Maybe I’ll work mixing both solutions:

Host it somewhere else while in development, and then when I"m about to deliver the project, I’ll just get everything into a .txt file and upload it to webflow (since I’m not going to be changing that anytime soon).

Thanks for your idea though, really useful

1 Like

Hey @webdev

Sorry, I’m still learning my ways with WF.

Could you tell me how to get the CDN URI? and what it is? Just confused on that part.

Thank you! :slight_smile:

When you view an asset in the asset panel there is a small icon that is linked to the URI. Copy that.

Hi,

I’m struggling to understand how it links to the area I want my embedded code to sit.

I’ve created the text file and added the line of code as suggested, but how do I now get that text file to work in the area I need it too?

Apologies if I’ve not made my self clear!

Here’s a link to the dev site with a version of the embedded code.

regards

David, I’m taking a quick look at your site- it’s better if you give a shared link to your project instead so people can see the internals and help you more easily.

However I can see the main problem- your TXT file contains pretty much an entire webpage-

https://assets.website-files.com/58c2c33f9ead937c39b5c40d/5f5f231270a6902dc0ea247b_1960-FINAL_IRTON%20Widget-10.txt

What you want in your script file is only the javascript itself, which is the part between the <script> tags. No HTML, no <link> elements, or other <script> elements.

All of that, including your forms is the content you’ll design in webflow, and then your script will act on those elements.

NB: just realized your post is from Sep a year ago, but I thought I’d finish it anyway in case it helps others.

1 Like

Mike – thanks for this. I had the same problem and this fixed it for me.

1 Like

Thanks for this hint, sound like it should help to solve my task.

But unfortunately, I have one issue working with it. I have connected it as you say, and I see that it’s trying to connect, but in console, I see this issue — “Cross-Origin Read Blocking (CORB) blocked cross-origin response https://uploads-ssl.webflow.com/62137ad6d5d5ce07016d06ca/6213a6251d6f8a1e544e8adf_slider-JS.txt with MIME type text/plain. See Cross-Origin Read Blocking (CORB) - Chrome Platform Status for more details.” — https://tppr.me/8kZHZ

Here is a read-only link to file

Can you help me to workaround this issue, and make that code work?

And thank you once again for this answer :relieved:

@anton_atom - Try removing the script tags. It’s not an HTML document.

That works perfectly!
Thank you!

Would this work for css codes??

Hi, Jeff,
thank you for the advice. For me, however, your suggestion is not working and I would like to understand why. Here’s what I did:

Created a TXT file

Added an asset, copied an URI and Added it to my embedding panel

What I see, however, is this:

Here’s a link to my webflow project: Rock Distribution updates in your email

What am I doing wrong?
Thanks in advance!

What I see is this


So it seems that it works correctly.

If not, please start a new topic.

Cheers!

I was experimenting with different options and the one you posted as current is just one option which is not what I need to see. What I need to see in my embedded form is this:

What I get when I copy the ActiveCampaign code in to HTML embedder in webflow is this:

In order to fix this, I started communication with webflow customer service and they sent me this way - “how to increase embedding character limit”. found this topic, tried out suggestions which do not work on my end. Willing to understand what am I doing wrong and how to fix it.

Thank you in advance.

@edgarsrakovskis - CSS is not JavaScript which that workaround was designed to address. If you want to host an external CSS file you need a server or service to do so. Webflow uses GitHub and JSDelivr to do so, which works just fine. If you have a server that can host assets you could use that. You can also break up CSS into multiple code embeds.

Thanks, Jeff.
I am having trouble setting up the GitHub, however, that seems to be the problem on my end tho. Thanks again.

Hi all,
I am planning to solve character limit problem by building a script/external file manager for webflow. Thinking of following features:

  • Multiple file type support - svg,css,js,html
  • CDN and file caching for better performance.

Would love to hear from you if you have more suggestions. You can reach out to me at himanshusaleria[at]gmail.com or twitter: himanshusaleria