Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0
OUTPOSTMTL

Force Java to load in Ajax

Question

Posted (edited)

Hello! (First Time Here)

I'm running into issues with a javascript not loading in a code block for a video player I am trying to implement. The scripts work and load on a local implementation  and on a non-squarespace hosted implementation. 

Here is the code in question:

<meta charset="UTF-8">
<html>
	<head>
		<script src="https://www.mysite.xyz/vendome/js/jquery-3.1.0.min.js"></script>
		<script src="https://www.mysite.xyz/vendome/js/jquery.cookie.js"></script>
		<script src="https://www.mysite.xyz/vendome/webrtc.js"></script>

	</head>
	<body>
		<div class="div-section">
			<table>

			<tr>
				<td><input type="hidden" id="sdpURL" size="50" value=""/></td></tr>
			<tr>
				<td><input type="hidden" id="applicationName" size="25" value=""/></td></tr>
			<tr>
				<td><input type="hidden" id="streamName" size="25" value=""/></td></tr>
			<tr>

			</table>

		</div>

		<div class="div-section">
			<video id="remoteVideo" autoplay playsinline controls muted style="width:1000px;"></video>
		</div>

		<td><input type="button" id="buttonGo" onclick="start()" value="" /></td>
		<input type="button" id="buttonCheckStream" onclick="getAvailableStreams()" value="Get Available Streams" />

		<script type="text/javascript">
			pageReady();
		</script>

		<div>
			<span id="sdpDataTag"></span>
		</div>
	</body>
</html>

jquery.cookie.js will not load causing the next scripts to not function. When you load the page we get "Uncaught TypeError: $.cookie is not a function".

I'm fairly certain that the jquery scripts aren't loading twice and over writing eachother like other posts have suggested. 

I've tried renaming the the cookie.js as well but no luck. 

Could this have something to do with AJAX? Is there anything we could do to force the scripts to load?

Any advice is appreciated! 

 

(Excuse the bad HTML, I'm from a python background.)

 

EDIT: The template is AJAX compatible and the option is enabled.

 

Edited by OUTPOSTMTL

Share this post


Link to post

5 answers to this question

Recommended Posts

  • 0

Did you disable ajax and see if it works?


If I replied to one of your questions with code, it was either CSS or jQuery.

To add CSS, go to Design -> Custom CSS

jQuery needs some additional steps. Head here: https://code.jquery.com/ and click on minified, under jQuery 3.x and copy that code into Squarespace.

After you put that code into the code injection section in Squarespace, you can add the code I supplied. The code from me will need <script> added before it and </script> added after it (only for jQuery).

There are two places that you can add the code, one is site wide (adds to all pages). Settings -> Advanced -> Code Injection

The other is for a specific page (adds to one page only). Pages -> Gear Icon next to the page -> Advanced

Share this post


Link to post
  • 0
Posted (edited)

Please provide a link to your page.

Where did that code come from?

The js links in the first block are not actual links, so if you are using that code exactly, that is part of the problem.

Edited by rwp

If I replied to one of your questions with code, it was either CSS or jQuery.

To add CSS, go to Design -> Custom CSS

jQuery needs some additional steps. Head here: https://code.jquery.com/ and click on minified, under jQuery 3.x and copy that code into Squarespace.

After you put that code into the code injection section in Squarespace, you can add the code I supplied. The code from me will need <script> added before it and </script> added after it (only for jQuery).

There are two places that you can add the code, one is site wide (adds to all pages). Settings -> Advanced -> Code Injection

The other is for a specific page (adds to one page only). Pages -> Gear Icon next to the page -> Advanced

Share this post


Link to post
  • 0
On 7/3/2020 at 12:13 PM, rwp said:

Please provide a link to your page.

Where did that code come from?

The js links in the first block are not actual links, so if you are using that code exactly, that is part of the problem.

The code is a front end for a streaming service we are building for our clients. The links were changed for privacy reasons. 

 

I can PM you the actual page if you'd like to take a look. 

 

Let me know.

 

Share this post


Link to post
  • 0

Sure, I will take a look.


If I replied to one of your questions with code, it was either CSS or jQuery.

To add CSS, go to Design -> Custom CSS

jQuery needs some additional steps. Head here: https://code.jquery.com/ and click on minified, under jQuery 3.x and copy that code into Squarespace.

After you put that code into the code injection section in Squarespace, you can add the code I supplied. The code from me will need <script> added before it and </script> added after it (only for jQuery).

There are two places that you can add the code, one is site wide (adds to all pages). Settings -> Advanced -> Code Injection

The other is for a specific page (adds to one page only). Pages -> Gear Icon next to the page -> Advanced

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...