Software Archive
Read-only legacy content
17061 Discussions

just : alert ("hello");

henry_p_2
Beginner
2,619 Views

Hello all..;

I don't understand... A javascript  alert("hello"); doesn't work ?

Is it absolutely necessary to use intel.xdk.notification.alert("hello") ?

Thanks for answers...

 

0 Kudos
14 Replies
Elroy_A_Intel
Employee
2,619 Views

It is not required or necessary to use any of the intel.xdk APIs. Alert messages are recommended to be declared in a JavaScript file or in a script tag. Where are you putting this code?

0 Kudos
Hamilton_Tenório_da_
Valued Contributor I
2,619 Views

Sometimes I use "alert" to test. It works normally.

0 Kudos
henry_p_2
Beginner
2,617 Views

Hello...

I write the javascript code between the <script> and </script> tag, generally in the head...

Do I need something special to run an alert ? I alse use   <script src="intelxdk.js" type="text/javascript"></script> but that give no change...

When I use intel.xdk.notification.alert(...)  I work just one time. Impossible to have two notifications one by one...

Can you give a example of index.html that works with a javascript alert("hello") code ?

Thanks...

 

 

0 Kudos
Hamilton_Tenório_da_
Valued Contributor I
2,617 Views

Nothing special to run.

Try to call on click like this: <a href="" onclick="alert('something')">Touch here</a>

0 Kudos
henry_p_2
Beginner
2,617 Views

I try this (not working) on Xdk 2548:

(Javascript is not working, it is just an html5 code, worling out of XDK... what's wrong ?)

<!DOCTYPE html>
<html>
<head>
    <title>Blank Standard HTML5 Web App Template</title>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">

    <!-- see http://webdesign.tutsplus.com/tutorials/htmlcss-tutorials/quick-tip-dont-forget-the-viewport-meta-tag -->
    <meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=no">
    <style>
        /* following two viewport lines are equivalent to meta viewport statement above, needed for Windows */
        /* see http://www.quirksmode.org/blog/archives/2014/05/html5_dev_conf.html and http://dev.w3.org/csswg/css-device-adapt/ */
        @-ms-viewport { width: 100vw ; min-zoom: 100% ; zoom: 100% ; }  @viewport { width: 100vw ; min-zoom: 100% zoom: 100% ; }
        @-ms-viewport { user-zoom: fixed ; min-zoom: 100% ; }           @viewport { user-zoom: fixed ; min-zoom: 100% ; }
    </style>

    <!-- Uncomment the following scripts if you convert your "Standard HTML5" project into a "Cordova" project. -->
    <!-- <script src="cordova.js"></script> -->          <!-- phantom library, needed for Cordova api calls, added during build -->
    <!-- <script src="js/app.js"></script> -->           <!-- recommended location of your JavaScript code relative to other JS files -->
    
    <script src="intelxdk.js" type="text/javascript">   
    </script>
    
    <script>
       alert("gggggg");
         <a href="" onclick="alert('something')">Touch here</a>
    </script>
   
    
    <!-- <script src="xdk/init-dev.js"></script> -->     <!-- normalizes device and document ready events, see README for details -->
</head>

<body>

    <p>Hello, Intel XDK!</p>
    
   

</body>
</html>

0 Kudos
henry_p_2
Beginner
2,616 Views

I tried it again again as just an html5app who work in any navigator :

I dont't have the prompt with XDK !

What's wrong ? I don't understand what how to do something with XDK ...

PLease an explication... Thanks...

 

<!DOCTYPE html>
<html>
<!--
  * Please see the included README.md file for license terms and conditions.
  -->
<head>
    <title>Blank Standard HTML5 Web App Template</title>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">

    <!-- see http://webdesign.tutsplus.com/tutorials/htmlcss-tutorials/quick-tip-dont-forget-the-viewport-meta-tag -->
    <meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=no">
    <style>
        /* following two viewport lines are equivalent to meta viewport statement above, needed for Windows */
        /* see http://www.quirksmode.org/blog/archives/2014/05/html5_dev_conf.html and http://dev.w3.org/csswg/css-device-adapt/ */
        @-ms-viewport { width: 100vw ; min-zoom: 100% ; zoom: 100% ; }  @viewport { width: 100vw ; min-zoom: 100% zoom: 100% ; }
        @-ms-viewport { user-zoom: fixed ; min-zoom: 100% ; }           @viewport { user-zoom: fixed ; min-zoom: 100% ; }
    </style>

    <!-- Uncomment the following scripts if you convert your "Standard HTML5" project into a "Cordova" project. -->
    <!-- <script src="cordova.js"></script> -->          <!-- phantom library, needed for Cordova api calls, added during build -->
    <!-- <script src="js/app.js"></script> -->           <!-- recommended location of your JavaScript code relative to other JS files -->
    <!-- <script src="xdk/init-dev.js"></script> -->     <!-- normalizes device and document ready events, see README for details -->
</head>

<body>

    <p>Hello, Intel XDK!</p>
    <script>
    
    alert("hello");
    </script>
</body>
</html>

 

0 Kudos
Hamilton_Tenório_da_
Valued Contributor I
2,617 Views

I created a new project and copy/paste your code. When I change to EMULATE tab, the message popup to me. It is working.

One sugestion: remove and reinstall the XDK. 

0 Kudos
henry_p_2
Beginner
2,617 Views

OK for your help.
I do that just now, try the code once again and come back with infos...

 

 

 

0 Kudos
henry_p_2
Beginner
2,618 Views

Hello I am back :-)

NO, sorry, after the complete reinstallation, il doesn't work.

All of my code work but impossible to have a popup in javascript...

I work with the Linux version 64 bits 2548.

In the past, I haven't this problem...

Does somebody use the same version ?

Thanks for help...

0 Kudos
henry_p_2
Beginner
2,617 Views

For the fun, I have tried the EA.

Just the same problem... Maybe my PC... But javascript works on all navigators and on all other IDE !

Don't understand....

0 Kudos
henry_p_2
Beginner
2,619 Views

And finally, I've reinstalled XDK 2548 under windows and javascript is well running !
I'm not sure XDK for Linux is really safe...

 

 

0 Kudos
Hamilton_Tenório_da_
Valued Contributor I
2,619 Views

Good news. Maybe Linux has any kind of block for popup. I am using Windows. 

0 Kudos
Ulrich_M_1
Beginner
2,617 Views

This seems to be an issue with the linux XDK.

I can reproduce this behaviour in XDK 2611. On a fresh linux system (Linux Mint 17.2, 64 bit) a simple alert() doesn't work in the emulator as described above, on a windows machine (Windows 8.1, 64 bit) it is working as expected.

Does anybody know how to fix this in linux XDK?

BTW I doesn't depend on enabling the cordova notification plugin

0 Kudos
henry_p_1
Beginner
2,617 Views
I see today that there is not yet any solution to the problem with ALERT for the linux users... Can't somebody correct this bug ?
0 Kudos
Reply