I'm new at ElectronJs, when I tried to open Go to page, a new page in the same window, it has opened a blank and white page.
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
<!-- All of the Node.js APIs are available in this renderer process. -->
We are using Node.js <script>document.write(process.versions.node)</script>,
Chromium <script>document.write(process.versions.chrome)</script>,
and Electron <script>document.write(process.versions.electron)</script>.
Go to page
<script>
// You can also require other files to run in this process
require('./renderer.js')
</script>
</body>
</html>
First, my code was like Go to page and then I changed my code to Go to page.
But this did not fix my problem, still not opening page.html.
I would like to make a multiple page GUI with electronJs, and I don't know how to figure out this white page problem.
Video demonstrating the problem
Files of the Project
i checked console.log() with mainWindow.webContents.openDevTools() and problem is wrong file path. When i opened my project with Electron Fiddle, it didnt took my folder path (C:\Users\Demir\Desktop\Softwares\li_software). Electron Fiddle opened my project from C:\Users\Demir\AppData\Local\Temp\tmp-10260KLe0XorfFNK8. So when i move my page.html or css files to tmp-10260KLe0XorfFNK8 folder, problem solved.
Related
I am currently working on a portfolio site through Cargo. I have minor understanding of writing script but have been attempting to load a 3D model onto my homepage. I found the tag and was wondering how to make it work, it is not visible on the screen right now.
<!DOCTYPE html>
<html>
<body>
<script type="module" src="https://unpkg.com/#google/model-viewer/dist/model-viewer.min.js"></script>
<model-viewer src="https://files.cargocollective.com/c1743864/exp_flower_oldv.obj" shadow-intensity="1" camera-controls touch-action="pan-y" generate-schema></model-viewer>
</body></html>
The code above I have attempted it and Cargo accepts it but the model is not visible. For
<script type="module" src="https://unpkg.com/#google/model-viewer/dist/model-viewer.min.js">
Do I copy and paste the code from this link and save it as an html file to then upload it onto cargo?
When I open live preview in brackets the page comes up but never finishes loading. Live preview has worked fine while working on HTML and CSS files, but now that I'm incorporating Javascript I am having this issue.
I have re-installed the program twice with no success, restarted my computer, tried running live preview while all extensions were disabled, and have searched through numerous pages on google on how to fix this issue with no solution.
Also it seems that adding the "script" tag (sourced to my javascript file) is causing the issue. When I run live preview without the tag it loads fine.
This has been an issue for some time so any guidance would be GREATLY appreciated. Thanks!
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Section 2: JavaScript Language Basics</title>
</head>
<body>
<h1>Section 2: JavaScript Language Basics</h1>
<script src="script.js"></script>
</body>
</html>
I've emptied the Javascript file in an attempt to identify the problem. As stated earlier this code alone would have live preview loading non-stop.
Please let me know if anymore information is needed. Thanks again!
I think it has to something with the directory like which folders you placed it in for example if the .js file is at the same place as the index.html then what you've done should work.
if not it's in, for example, a folder called "js" then use something like
<script src="../js/script.js"></script>
play around with
../
or
./
because I can't tell without seeing your file structure I can't really know what's happening.
I'm not experienced with Visual Studio 13 at all, but I managed to compile a simple HTML5 website so that it displays in an app.
I run a website, that I'd basically like to integrate into a Windows 8.1 UI app. I've tried code like this:
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="1;url=http://mywebsite.com">
<script type="text/javascript">
window.location.href = "http://mywebsite.com"
</script>
<title>Page Redirection</title>
</head>
<body>
<!-- Note: don't tell people to `click` the link, just tell them that it is a link. -->
If you are not redirected automatically, follow the <a href='http://mywebsite.com'>link to example</a>
</body>
</html>
however it gives me an APPHOST9624 error. Even when I click on the HREF link it fails.
Obviously I'm going about this in the wrong way, so my question is. How do I create a Windows 8.1 store app that simply displays the external website fullscreen?
Edit: You actually want to integrate the website in your store app so this solution won't work for you, just noticed that :) There also seems to be a WebView Control though all examples are in XAML, so it might not be supported in HTML5 apps...
I would recommend you launch the default browser with that new URI, though that would open a new browser instance, not sure if that's what you want in your case. For that, try calling
Windows.System.Launcher.launchUriAsync(uri).done( /* Your success and error handlers */ );
Source
in a blackberry webworks application i try to load a page into an iframe that is packaged with the app, but the app keeps crashing (it opens the splash screen and doesnt load anything)
The page i want to load is located at (relative to the index.html of my app):
./pages/help_en/home.html
and i tried to load it with this paths:
pages/help_en/home.html
./pages/help_en/home.html
local:///pages/help_en/home.html
but all of them lead to that crash.
When i load it from an external server, it works fine...
Maybe i should also mention, that it only happens on Smartphones, on PlayBook (Tablet) it works fine.
Any help would be appreciated, thank you in advance!
The below code sample should work to load a local page (within the app) into an iframe. It also uses the same folder structure as yours. It has been tested and packaged into a WebWorks app and loaded onto a device and the page loads properly in the iframe. Along with a main page, ensure that you also include a config.xml file.
<!DOCTYPE html>
<html>
<head>
<title>Iframe</title>
<meta id="viewport" name="viewport"
content="initial-scale=1.0,width=device-width,user-scalable=no,target-densitydpi=device-dpi"/>
<script type="text/javascript">
function changeSrc(){
document.getElementById('theFrame').src = "pages/help_en/home.html";
}
</script>
</head>
<body>
Iframe is below<br/>
<button onclick="changeSrc()">click me</button><br/>
<iframe id="theFrame" src=""></iframe>
</body>
</html>
Should be a really quick one for you pro's:
I'm learning to use JS, in particular a plugin called (embarassingly) 'Easy Image'.
http://cssglobe.com/post/3783/jquery-plugin-easy-image-or-content-slider
Here's my code:
http://jsfiddle.net/tomperkins/LnES6/
JS files are from here:
http://cssglobe.com/post/3783/jquery-plugin-easy-image-or-content-slider
And obviously jQuery (1.5)
I've stripped it down to the basics and can't figure out why it's not working.
Any tips are much appreciated!
Thanks in advance,
Tom
jquery.js and easySlider.js gets an Server error 500 when the browser tries to load them from
http://customstudiodevelopment.co.uk/jquery-test/
Verify that the files are there and that they can be loaded
http://customstudiodevelopment.co.uk/js/jquery.js
http://customstudiodevelopment.co.uk/js/easySlider.js
Unless both these urls load the right JS files your code will not work ...
As a general tip, get FireBug addon to firefox, with the Net panel I found this error in less than 30 seconds ;)
In menu on the left you have to set your framework to JQuery and in Add resources box add 'Easy Image' script. Then comment out first two <script> tags (you will need them on your site but not on jsFiddle). Also change src attributes in <img> tags to absolute path because there is no images folder nor any images on jsFiddle site.
Edit
This is what you get with <script> tags on your site:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
2<html><head>
3<title>500 Internal Server Error</title>
4</head><body>
5<h1>Internal Server Error</h1>
6<p>The server encountered an internal error
Script doesn't work because there are no scripts on your site (both links are dead).
This is working:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<base href="http://customstudiodevelopment.co.uk"/>
<script type="text/javascript" src="/jquery-test/js/jquery.js"></script>
<script type="text/javascript" src="/jquery-test/js/easySlider.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#slider").easySlider();
});
</script>
<meta charset="utf-8">
<title>jQuery Gallery Test</title>
<link href="/jquery-test/css/style.css" rel="stylesheet" type="text/css" media="all">
</head>
<body>
<div id="slider">
<ul>
<li><img src="/jquery-test/images/Website-Strip_Future.png"></li>
<li><img src="/jquery-test/images/SR-Toomer_small.png"></li>
</ul>
</div>
<!-- /end #slider -->
</body>
</html>
Note, I put the base element in there to test on my desktop. It's not required for it to work on your server, but if it's on your desktop computer, it should work (so you can copy the html into a Notepad file and save with filetype .html and run it locally to test).
It appears as if your file includes (js/css/image) are not pointing to where you want them to be.
Use Firebug to test these types of things. When you open the console, you can inspect the scripts included, including open each included file. In this way, you can doublecheck to make sure the browser is able to get to your included files.
http://getfirebug.com/
http://getfirebug.com/wiki/index.php/Script_Panel
http://getfirebug.com/wiki/index.php/File:Script_Panel.png <<< see del-linkrolls.js close to top, right; that's where you select which file to inspect
When I loaded the page I got an ".ready() is not a function" which would mean you are not loading jQuery. Then again I've never fooled around with jsfiddle