我的.h文件中有以下代码:
#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>
#import <AVFoundation/AVFoundation.h>
#import <MapKit/MapKit.h>
@interface LandingController : UIViewController<CLLocationManagerDelegate> {
CLLocationManager *LocationManager;
AVAudioPlayer *audioPlayer;
}
@property (nonatomic, retain) NSTimer *messageTimer;
- (IBAction)LoginButton:(id)sender;
@end
Run Code Online (Sandbox Code Playgroud)
我的.m文件中有以下代码:
@interface LandingController ()
@end
@implementation LandingController
@synthesize messageTimer;
- (void)checkForMessages
{
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"BINGO:"
message:@"Bingo This Works"
delegate:nil
cancelButtonTitle:@"Okay"
otherButtonTitles:nil];
[alert show];
}
- (IBAction)LoginButton:(id)sender {
if ([UserType isEqualToString:@"Owner"]) {
if (messageTimer){
[self.messageTimer invalidate];
self.messageTimer = nil;
}
} else {
if (!messageTimer){
self.messageTimer = [NSTimer scheduledTimerWithTimeInterval:10.0
target:self
selector:@selector(checkForMessages) …Run Code Online (Sandbox Code Playgroud) 我有这个onclick电话:
onClick="mySubmit();
Run Code Online (Sandbox Code Playgroud)
调用此函数:
function mySubmit(){
document.getElementById("myForm").submit();
}
Run Code Online (Sandbox Code Playgroud)
然后提交此表单:
<form id="myForm" action="action.php" method="post">
Run Code Online (Sandbox Code Playgroud)
我的问题是:如何从onClick向表单发送变量以获得类似的东西<form id="myForm" action="action.php?id=**(the variable sent from the onclick goes here)**" method="post">
谢谢!
我希望能够提交表单,但我不想点击提交按钮,我希望能够点击一个<li>元素并让它提交.
任何帮助都会很棒!
提前致谢!
Ncoder
如何为以下jQuery自动完成指定结果的宽度?
$( "#autocomplete" ).autocomplete({
minLength: 2,
source: function( request, response ) {
var matcher = new RegExp( "^" + $.ui.autocomplete.escapeRegex( request.term ), "i" );
response( $.grep( tags, function( item ){
return matcher.test( item );
})
}
});
Run Code Online (Sandbox Code Playgroud)
谢谢!
建立一个网站,成员可以将其网络摄像头流式传输到我的服务器,以便其他成员可以查看当前正在流式传输的实时源.
如何获取会员的网络摄像头,将订阅源推送到服务器,然后允许其他人实时查看订阅源?
该网站是基于网络的,用PHP编写,带有MySQL数据库 - 但我愿意添加Javascript,jQuery,Flash或其他任何工作.
我知道这很广泛但真的需要一些指导!
我有一个NSTimer每10秒运行一次,并从LandingController.m开始.当您转到应用程序中的其他视图时,它将继续运行.我希望能够(当在该计时器内满足某个条件时)从另一个视图更新标签字段GuardMenu.m我想要更新的标签名为CurrentZone.text,我想将它从值"N"更新为值"Y".
这是我在LandingController.m上的计时器
self.messageTimer = [NSTimer scheduledTimerWithTimeInterval:10.0
target:self
selector:@selector(checkForMessages)
userInfo:nil
repeats:YES];
Run Code Online (Sandbox Code Playgroud)
在LandingController.m上调用它
- (void)checkForMessages
{
if ( //some condition here ){
//update CurrentZone.text label in GuardMenu view and set equal to "Y"
} else {
//no need to update label in GuardMenu as it's currently equal to "N"
}
}
Run Code Online (Sandbox Code Playgroud) forms ×2
nstimer ×2
objective-c ×2
submit ×2
autocomplete ×1
html-lists ×1
ios ×1
javascript ×1
jquery ×1
onclick ×1
streaming ×1
variables ×1
viewing ×1
webcam ×1