This example is lame, it doesn't use a <script> tag to link in the javascript. What should I change?

beavoid
beavoid used Ask the Experts™
on
Hi, in the Xcode IDE for javascript,

How do I setup this example code correctly?
This example will get me going full speed ahead..
ie, what do I name the html section and the javascript section? (labeled "the code used is:")
and do I copy the entire code section into its own file? Separate would be better.
Also, there is no <script...> code to link the code into the HTML
Should I add that anywhere before?
where it says, "the HTML markup is:"

Also..What else must be done to get this working? What are some exploitable mistakes I can make? How do coders make it simple to code swipe games w/o using a phone for test?
Link the mouse in to the swiping? How?
Can you see the PNG's for the arrow pics?
The code first example page is here

Maybe this page is better? here

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Hi,

I'm using https://www.browserstack.com to test on multiple OS / device.
(you can do manual and automatic tests)

Saucelab is another solution https://saucelabs.com/


For physical test like Touch, it is always better to do it with real device...

You can ask your friend and family to start and you can have a beta tester group that you hire or you give them something in exchange.
Scott FellDeveloper & EE Moderator
Fellow 2018
Most Valuable Expert 2013

Commented:
Are you using Chrome Dev tools?  https://developers.google.com/web/tools/chrome-devtools/device-mode This is what I use.  

I have not used a Mac myself in about 3 or 4 years. When I used XCode, there was a simulator you can access. https://help.apple.com/simulator/mac/current/#/deve44b57b2a
beavoidSelf Employed

Author

Commented:
Thanks
So, most developers are happy to work with mouse listeners during dev and change that to touch listening later?
My question is mainly concerned with the lack of <script> tags in my first example.

I suppose if I put all that code in one file, it will work?

And, if I start off right away calling <script src = "code_file.jsp">
it will be good?
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Hi,

Yes you can use
<script src = "code_file.jsp">

Open in new window

or  
<script> your code </script>

Open in new window


Let me know if this is working or not, and if not check errors in console.
Scott FellDeveloper & EE Moderator
Fellow 2018
Most Valuable Expert 2013

Commented:
I think I meant that is for emulating touch. But nothing is the same as an actual device.  It's been a while, but xcode has option for this too https://developer.apple.com/library/archive/documentation/ToolsLanguages/Conceptual/Xcode_Overview/RunningintheSimulator.html#//apple_ref/doc/uid/TP40010215-CH54-SW1  I would still want to test on a device though.

<script src = "code_file.jsp">
it will be good?

jsp files are referring to java server pages and not the same as javascript. I think you mean javascript files which will end in .js
<script src = "code_file.js"></code>

Open in new window

beavoidSelf Employed

Author

Commented:
I put this up from an example from GitHub on my dev space

http://jamescomp.com/iodev/

Does that look ready for adaptation into my own game?
Is it secure? ready for prime-time?
It works on windows and MacBook and iPhone.
What extra devices of yours might it or might it not work on?

Thanks
beavoidSelf Employed

Author

Commented:
Thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial