小编pra*_*d22的帖子

如何在PHP中显示警告框?

我想显示一个显示PHP消息的警告框.

这是我的PHP代码:

<?php  
  header("Location:form.php");

  echo '<script language="javascript">';
  echo 'alert(message successfully sent)';  //not showing an alert box.
  echo '</script>';
  exit;
?>
Run Code Online (Sandbox Code Playgroud)

但它没有用.

html javascript php alert

47
推荐指数
4
解决办法
58万
查看次数

在选定的时间和日期设置闹钟

我正在开发Android 2.1上的任务管理器.我想为datepicker中的日期设置任务设置警报和时间选择器的时间帮助我使用代码..

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    final EditText next = (EditText) findViewById(R.id.editText1);
    final Button sub = (Button) findViewById(R.id.button1);
    final Button res = (Button) findViewById(R.id.button2);
    final DatePicker dp = (DatePicker) findViewById(R.id.datePicker1);
    final TimePicker tp = (TimePicker) findViewById(R.id.timePicker1);

    sub.setOnClickListener(new View.OnClickListener() {
        public void onClick(final View view) {

             int y=dp.getYear();
             int mo=dp.getMonth();
             int day=dp.getDayOfMonth();

            Time t = new Time();
                                    int h=t.getCurrentHour();
                                    int m=t.getCurrentMinutes();

    }

 private AlarmManager getSystemService(String alarmService) {

            // TODO Auto-generated method stub
            return null;
        }

    });
Run Code Online (Sandbox Code Playgroud)

android android-alarms

4
推荐指数
1
解决办法
9350
查看次数

如何重置datepicker

我正在开发Android 2.1上的任务管理器.我想在单击重置按钮到当前日期和时间时重置日期和时间.帮我处理代码..

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final EditText next = (EditText) findViewById(R.id.editText1);
final Button sub = (Button) findViewById(R.id.button1);
final Button res = (Button) findViewById(R.id.button2);
final DatePicker dp= (DatePicker) findViewById(R.id.datePicker1);
final TimePicker tp = (TimePicker) findViewById(R.id.timePicker1);

res.setOnClickListener(new View.OnClickListener() {     
 public void onClick(final View view) {                  
     next.setText("");
     dp.refreshDrawableState();
        }       
    });    
}}
Run Code Online (Sandbox Code Playgroud)

datetime android

3
推荐指数
1
解决办法
3939
查看次数

切换活动时运行进度条

我陷入了从活动1切换到活动2的情况.我使用Thread.sleep(5000)在5秒后启动另一个活动但我想要运行五秒钟的进度条也会在第一个活动中休眠Pleaze帮助我,当我点击第一个活动上的下一个按钮时,进度条会运行五秒,然后应该加载活动我的代码是:

    public class Activity1 extends Activity  {          
    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    Button next = (Button) findViewById(R.id.B);
    final ProgressBar  p=(ProgressBar) findViewById(R.id.pr);
    next.setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
              p.setVisibility(4);
            Thread t=new Thread();
            try{                    
                t.sleep(5000);              

        }
            catch(Exception e){}

            Intent myIntent = new Intent(view.getContext(), activity2.class);
            startActivityForResult(myIntent, 0);
        }

    });   

}}
Run Code Online (Sandbox Code Playgroud)

android

1
推荐指数
1
解决办法
7303
查看次数

将jquery.min.js文件添加到phonegap eclipse应用程序中

我在phonegap eclipse应用程序中第一次使用jquery.我从internet.now下载了jquery.min.js文件我想将该文件包含到我的项目文件夹中.所以请帮我怎么做?

eclipse eclipse-plugin jquery-mobile cordova

1
推荐指数
1
解决办法
1274
查看次数

通过jsp发送电子邮件

我正在尝试设计一个jsp页面,我可以在其中发送电子邮件,但是在核心java中正确运行的代码在jsp代码中使用时会给我异常.我相信我已经将我的mail.jar妥善放入了lib.

当前的jsp代码是:

<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>

                <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

                <html>
                <body>

                <%@ page import="java.util.Properties" %>               
                <%@ page import="javax.mail.Message" %>
                <%@ page import="javax.mail.MessagingException" %>
                <%@ page import="javax.mail.PasswordAuthentication" %>
                <%@ page import="javax.mail.Session" %>
                <%@ page import="javax.mail.Transport" %>
                <%@ page import="javax.mail.internet.InternetAddress" %>
                <%@ page import="javax.mail.internet.MimeMessage" %>


                <%
                Properties props = new Properties();
                        props.put("mail.smtp.host", "smtp.gmail.com");
                        props.put("mail.smtp.socketFactory.port", "465");
                        props.put("mail.smtp.socketFactory.class",
                                "javax.net.ssl.SSLSocketFactory");
                        props.put("mail.smtp.auth", "true");
                        props.put("mail.smtp.port", "465");

                 Session.getDefaultInstance(props,
                            new javax.mail.Authenticator() {
                                protected PasswordAuthentication getPasswordAuthentication() {
                                    return new PasswordAuthentication("prakash.d2222","**************");
                                } …
Run Code Online (Sandbox Code Playgroud)

java email jsp

-3
推荐指数
1
解决办法
3053
查看次数