Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Nokimemota · Jun 09, 2017 at 06:43 AM · webgljsonembed

WebGL embed in asp.net mvc

So i made a sudoku game that i want to insert into a webpage i made in asp.net in mvc, i tried to just paste files, but that didn't work so i tried to paste the build folder into the folder with correct view, an in the index.cshtml add the lines

 <script src="~/Scripts/UnityLoader.js"></script>    
 <script>
             var gameInstance = UnityLoader.instantiate("gameContainer", "Build/Testing.json"); 
 <script>
 <div id="gameContainer" style="width: 775px; height: 600px; margin: auto"></div>

going into the page throws the error which says:

An error occured running the Unity content on this page. See your browser JavaScript console for more info. The error was: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

I have no idea where to look for help, since checking debugger says it's the normal part of JSON.parse function, that works if i try to open the index.html file provided by unity, so what do i do?
Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Vojtasle · Jun 09, 2017 at 11:24 AM 0
Share

Hello, I have run into similar problem but I have solved it different way. There is pretty nice website dedicated to indie developers and you can publish your game very easily there. ITCHIO . If you really want to put it into your website, I believe its gonna be some missing .js files but I did not have enough patience to deal with it.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by marman123 · Jan 23, 2019 at 01:41 PM

I face the same problem. I have been struggling with solutions related to web.config file with mime types, but nothing seems to be working for me. Have you come to any solution @Nokimemota for this?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by virus4297 · Oct 21, 2020 at 03:10 PM

I found this amazing answer on StackOverflow. Link Click Here - Can not upload Unity WebGL in ASP.Net with an error of “The error was: SyntaxError: expected expression, got '<”

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How do I get into my StreamingAssets folder for the Web? 0 Answers

Reading .json file from WebGL build 0 Answers

Is there any limitations to deserializing json on webgl? 0 Answers

json webGL no work Unity 2018.3.3f1 0 Answers

WebGL Redirect 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges