javascript,function,button,onclick,assignRelated issues-Collection of common programming errors
shoriwa-shaun-benjamin
java javascript android cordova webview
I am trying to get my cordova webview to work with cordova 3.2 an use the phonegap Camera API to access the camera.Reference: Android WebViewsHere are some successful implementations of what I want to do, but these use Phonegap 1.9, i want to use Phonegap 3.2 (the latest one)Cordova WebView using AndroidAlso here’s a VideoWith the code below I am able to make the cordova webview display my index.html page without any issues but when I to access the camera by clicking on “Capture Photo” in my HTM
Inator
php javascript apache nosql couchdb
I’ve recently successfully installed CouchDB version 1.2.1 and as a test I can access it using the following Apache rewrite in CentOS 6:RewriteRule couchdb/(.*)$ http://127.0.0.1:5984/$1 [QSA,P]I have a PHP authentication class that I use across a home grown API to support my mobile apps. My API accepts and authenticates each request using an HMAC signature that is included in the URL like so:https://api.domain.com/endpoint/?timestamp=[timestamp]&signature=[signature]&id=[id]…etcEach
novicePrgrmr
java javascript ajax json jsp
I am sorry to ask this but i’ve been working on this for hours and I can’t figure it out on my own. I have to use json for part of a project and I was able to get it to work but now it’s not returning it back to the right jsp but instead just displaying the json jsp. I am pretty sure it is how I am receiving the json.here are screen shots of what is happening:this is the jsp that I need to use ajax on, I am wanting to populate the second dropdown using ajax:this is what is happening instead, (it
Andrew Whitaker
javascript regex
I am trying to build a regexp from static text plus a variable in javascript. Obviously I am missing something very basic, see comments in code below. Help is very much appreciated:var test_string = “goodweather”;// One regexp we just set: var regexp1 = /goodweather/;// The other regexp we built from a variable + static text: var regexp_part = “good”; var regexp2 = “\/” + regexp_part + “weather\/”;// These alerts now show the 2 regexp are completely identical: alert (regexp1); alert (regexp2);/
DOTang
javascript regex
I am searching for text inside of website resources (html and javascript), and need to identify 3 regular expressions that will locate this text under certain circumstances:some string of text when it is contained inside of a javascript single-quoted string some string of text when it is contained inside of a javascript double-quoted string some string of text when it is not contained inside of a javascript stringHere are some scenarios that are likely to occur (searching for the string “somestr
Andy E
javascript html
I’m building up a row to insert in a table using jQuery by creating a html string, i.e.var row = “”; row += “<tr>”; row += “<td>Name</td>”; row += “<td><input value='”+data.name+”‘/></td>”; row += “</tr>”;data.name is a string returned from an ajax call which could contain any characters. If it contains a single quote, ‘, it will break the HTML by defining the end of the attribute value. How can I ensure that the string is rendered correctly in the brow
sameer
javascript angularjs maven yeoman
I have recently integrated maven yeoman plugin with my app. I followed https://github.com/trecloux/yeoman-maven-plugin/blob/master/TUTORIAL.md My angular version is v1.2.3 . When I run the mvn clean install command, I get the following error . [email protected] node_modules\grunt-contrib-imagemin ?ö£?öÇ?öÇ [email protected] ?ö£?öÇ?öÇ [email protected] ([email protected], [email protected]) ?ö£?öÇ?öÇ [email protected] ([email protected]) ?ö£?öÇ?öÇ [email protected] ([email protected]) ?ö£?öÇ?öÇ p
Ronald Yeung
javascript jquery ajax json cors
What I am trying to do is to have a page on the HTTP protocol sending an AJAX call to the same Web server but using HTTPS. Both the requesting page and the AJAX handler are on the same server, having the same domain and port. (I.e., only difference is the protocol.) To illustrate,Fromhttp://www.example.com/index.phpTriggers a jQuery AJAX call tohttps://www.example.com/authenticate.php?user=123&password=456(I am hoping to pass the password through HTTPS to make it encrypted over the Internet.
stanleyhope
javascript ajax ssl internet-explorer-8
The problem: I have a site with a recently installed SSL certificate that is very dependent on POST calls over AJAX. The site worked fine on Internet Explorer 8 before the SSL certificate, but now does not.Since I haven’t been able to get a good way to read any error messages, I haven’t been able to pin down where the bug is coming from. I will try to list as much as I know/ have figured out, and I greatly appreciate any suggestions.What I know:On IE8, the site will not perform any AJAX POST cal
Mac-Gon
javascript jquery html5 css3 navigation
I’ve been reading lots of the other posts, and no doubt it’s my inexperience with jQuery that is giving me trouble, but there are lots of things close to what I’m trying to accomplish. I have a div where I have a vertical navigation set of buttons. Inside that I want the other divs (child divs) that will be shown or hidden based on the navigation button clicked by the user. I want all of these divs to be in the same location on the screen…so, basically like a tabbed form but with vertical navi
Alaska Zach
javascript function events
I’m trying to make it so I don’t have a write a function for every input field I want to use this on. Rather sending the element id to the function and only having one function that I can recycle.Works like this<input name=”field” id=”field” type=”text” onKeyPress=”onlyNum()” /><script type=”text/javascript”> function onlyNum() {var name = $(“#field”);name.keypress(function (e) {if (e.which > 0 && // check that key code existse.which != 8 && // allow backspace!(e.w
user1860536
php function preg-replace str-replace
I try change characters by functions<?php $string = “Hi everybody people [gal~images/articles~100~100~4] here other imagen [gal~images/products~100~100~3]”;$regex = “/\[(.*?)\]/”; preg_match_all($regex, $string, $matches);for($i=0; $i<count($matches[1]);$i++) { $match = $matches[1][$i]; $array = explode(‘~’, $match);//$newValuet=”gal(“”.$array[1].””,””.$array[2].””,””.$array[3].””,””.$array[4].””)”;$newValue=”gal(“.$array[1].”,”.$array[2].”,”.$array[3].”,”.$array[4].”)”;$string = str_repl
gnat
c arrays function multidimensional-array
Say I have an array: array[2][4], and inside the main method, I have a call to a function blackandwhite. How can I pass this method the length and width of the array as arguments?
FistOfFury
sql sql-server performance function user-defined-functions
I have a database with a lot of UDFs that contains a long running process involving lots of data manipulation and calculations. My thinking in using UDFs is to separate out logical units of information from the tables underlying. For example, if i am trying to get information about a car i might have several tables like Color, Model, Year, etc that i would have to join each time to get a Car. Instead, I would have a function like fnCar() to get a denormalized view of the data.I call these fun
karlphillip
c osx function symbols hacking
Is there a tool for reading Mac OS X binaries that would print information about relocation tables and symbol offsets similar to this readelf output?readelf -r appRelocation section ‘.rel.dyn’ at offset 0x5ec contains 2 entries:Offset Info Type Sym.Value Sym. Name 08049d58 00001706 R_386_GLOB_DAT 00000000 __gmon_start__ 08049d60 00000305 R_386_COPY 08049d60 _ZSt4coutRelocation section ‘.rel.plt’ at offset 0x5fc contains 13 entries:Offset Info Type
eagertoLearn
python function varargs default-parameters
when I try the following, I get error in the function definition itself.>>> def mymap(*seq,pad=None):File “<stdin>”, line 1def mymap(*seq,pad=None):SyntaxError: invalid syntax I am trying to give default value for the parameter pad. but then, I tried this and it works (for wrong reason):>>> def mymap(pad=None,*seq): … print seq >>> mymap([1,2,3],[4,5,6]) ([4, 5, 6],) [(4,)] >>> It is not printing the tuple of seq which should be ([1,2,3],[4,5,6]).
Richard Rodriguez
php arrays function
I have the following function:function percentToColor($percent){$minBrightness = 160;$maxBrightness = 255;// Remainins?$brightness = ((($minBrightness-$maxBrightness)/(100-0))*$percent+$maxBrightness);$first = (1-($percent/100))*$brightness;$second = ($percent/100)*$brightness;// Find the influence of the middle color (yellow if 1st and 2nd are red and green)$diff = abs($first-$second);$influence = ($brightness-$diff)/2;$first = intval($first + $influence);$second = intval($second + $influence);
Bach
python function exception-handling return
I defined the following function to test if an input is a positive int. I plan on using eval(raw_input(“…”)) so that’s why the try-except part is there:def is_ok(x): # checks if x is a positive integeris_int = Falseis_pos = Falsetry:if type(eval(x)) == int:is_int = Trueif x > 0:is_pos = Trueelse:passelse:passexcept NameError:is_int = Falseprint “not even a number!”return is_int, is_pos if I try to pass a positive int it would return True, True as expected. It returns False, False
Inherent
javascript function object copy assign
I am new to Java Script and I don’t understand, what a variable is storing, if it gets the return value of a function that is a object. My fear is, that such a variable is not storing the value, but only a link to a memory, that is maybe overwritten a little later.I tried this to find it out:This function returns a object with the content: name=”first” or name=”second”:var returnObject = function (theSecond) {var obj = { name : “first” };if (theSecond) {obj.name = ‘second’;}return obj; };2 varia
McGarnagle
r function for-loop time-series derivative
So I have a time series of MODIS NDVI values (vegetation values from 0-1 for the non-geographic geeks), and I’m trying to approximate the derivative by using a for loop.This is a sample of my data:> m2001date value valnorm 1 1 0.4834 0.03460912 2 17 0.4844 0.03664495 3 33 0.5006 0.06962541 4 49 0.4796 0.02687296 5 65 0.5128 0.09446254 6 81 0.4915 0.05109935 7 97 0.4664 0.00000000 8 113 0.5345 0.13864007 9 129 0.8771 0.83611564 10 145 0.9529 0.99043160 11 161 0.
merrill
listview button activity back
I have a mainActivity which is Customer.java with listview of 5 diff. activities. I was able to open all 5 activities when I tap them but when i press back button(the device backbutton) to go back to the mainAcitivity it would give me an error which you will see debug/logcat below the codes. I have post 2 examples activity below my main screen (logout and clockin) . Bonus: As one extra thing I would like to have is when click of the ‘clockinActivity’ button i want it to send the current time &am
DylanMark
java android xml button menu
Especially android-developers 🙂 I have some troubles with application menu which i try to create.When I click on some button – apllication says that process stopped unexpectedlyI make it almost like in manual here(http://www.droidnova.com/creating-game-menus-in-android,518.html) but their sample works and my code not! I don’t understand what i’ve done wrong, please, can somebody help?main.xml<?xml version=”1.0″ encoding=”utf-8″?> <RelativeLayout android:id=”@+id/widget32″ android:layo
GrayFox
android xml android-layout button back
I can’t find a way how to make it work. So here it goes:Application starts and I press Option menu and it offers me “Settings” option, and when I click it, it goes to layout called “help.xml” which shows me some text …And in that layout I created a button which must return me to my activity ( the window which is shown when app starts) I tried making a back button works but I failed cause I need for user to wait 30 seconds until the next image switch , and by making back button works hw would e
Guy Richards
android eclipse button
I’m trying to load a second layout after the click of a button but for some reason the application keeps crashing… I’m pretty sure I did everything right – but it’s still failing for some reason after each time I click on the save button at the bottom of the screen.P.S.If any more information is needed please let me know. I’ll be happy to provide it.JAVApackage com.example.linkingmanager;import android.app.Activity; import android.os.Bundle; import android.widget.Button; import android.content
wocmultimedia
android button android-intent google-play
I’m trying to launch the page of my app in android market from my activity. I am novice and maybe I’m making wrong coding this is what I wrote in the note.class import android.app.Activity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.webkit.WebView; import android.widget.Button;public class Note extends Activity{WebView mWebView;W
Chris Brendan
java android button media-player
I’m working on a drumpad with multitouch. I have used an inner class which extends a button:package dubstep.brendan;import android.content.Context; import android.media.MediaPlayer; import android.util.AttributeSet; import android.view.MotionEvent; import android.widget.Button;public class TestButton extends Button { private MediaPlayer mpButtonClick =MediaPlayer.create(getContext(),R.raw.firework);public TestButton(final Context context, final AttributeSet attrs) {super(context, attrs);// TODO
santirivera92
android button textcolor
I have a regular button which looks like this:<Buttonandroid:id=”@+id/button1″style=”@style/ButtonInfo”android:layout_width=”match_parent”android:layout_height=”wrap_content”android:layout_marginLeft=”10dip”android:layout_marginRight=”10dip”android:text=”Button” />ButtonInfo looks like this:<style name=”ButtonInfo” parent=”@android:style/Widget.Button”><item name=”android:background”>@drawable/button_info</item><item name=”android:textColor”>@color/button_info_text&
mikeTheLiar
ios facebook button facebook-like
I would like to know whether it is possible to add a Facebook Like button to a native iPhone app. In the app, the user browses a business directory or deals. When they tap on an item to view the details, it would be nice to have a Facebook Like button that can be used to post the item to the user’s Facebook page.Facebook writes: “Currently, the Like button is only available in mobile web apps”.My app is a native app and not a web app, so therefore I assume it’s not possible. However, I do assume
Melquiades
java android button
I’m trying to put a Start New Game (Joc nou) button, but when I press this button, it is not working as it should. Usually, it starts a new game but it also puts an ‘X’ on the first position of the table (mBoardsButtons[0])package xsi0.cristi.ro;import android.os.Bundle;import android.app.Activity;import android.graphics.Color;//import android.view.Menu;import android.view.View;import android.widget.Button;import android.widget.TextView;//import android.view.*;public class MainActivity extends A
Antony
php html table button
I am struggling to make a button appear in my table. I have seen various other answers on here but are a little too complicated for me (ie use javascript or are seeking to remove things from and to a database)My code is below and its the 8th line I am having trouble with (the table works fine without that line) – just says ‘unexpected ‘<‘?All I am seeking to do is show a button which will link to another website. That website is dictated by the variable ‘book’ which I pull from a database.ech
tylerjroach
android sqlite listview checkbox onclick
I am a beginner when it comes to programming with Android/Java, and I am having trouble with what shouldn’t be too difficult to accomplish. I am using code I’ve tried to adapt from the Google Notepad v1. I realize this version is far from complete, but it was the most stripped down to begin on. What I am trying to do is modify the list to note include notes, but rather make it function like a to-do list, where one would add items to the list. Next to each item, there needs to be a checkbox. I’m
death2all110
java android onclick alertdialog
I’m trying to show an about page to the users of my wallpaper app when they click the about button however i get leaked window errors in a log cat and the activity quits before it shows the dialog.Here is the code:/*** Sensational Wallpapers Pack 1** Wallpaper Designed by AZ2ENVY**/package com.death2all110.SensationalWallpapers1;import android.app.Activity; import android.content.res.Resources; import android.graphics.BitmapFactory; import android.graphics.Bitmap; import android.graphics.drawabl
JoshDM
android android-layout onclick onclicklistener findviewbyid
Android application keeps crashing on start-up. Everything appears fine to me, though.Stack trace: 01-24 21:23:41.417: I/Process(767): Sending signal. PID: 767 SIG: 9 01-24 21:41:36.316: W/Trace(890): Unexpected value from nativeGetEnabledTags: 0 01-24 21:41:36.485: W/Trace(890): Unexpected value from nativeGetEnabledTags: 0 01-24 21:41:36.515: W/Trace(890): Unexpected value from nativeGetEnabledTags: 0 01-24 21:41:36.515: D/dalvikvm(890): newInstance failed: p0 i0 [0 a1 01-24 21:41:36.515: D
Aleksandar Milicevic
onclick titanium appcelerator alloy-ui
I have an onClick listener added to an ImageView in index.xml. clicking the ImageView does not fire the function specified in the index.js, however adding the onClick to the containing view does. It’s almost as if the containing view is catching the click and not allowing the contained ImageView to receive it. However, I have several of these and others seem to work fine.index.xml:<Alloy> <Window class=”container” onOpen=”onWIndowLoad”><View id=”wholeView”><!– header –>
Jav_Rock
android onclick
Hi I have implemented this code:Button goToRegister = (Button) findViewById(R.id.reg);goToRegister.setOnClickListener(new View.OnClickListener() {public void onClick(View v) {// TODO Auto-generated method stubIntent intent = new Intent(MindMappingLoginActivity.this, MindMappingRegisterActivity.class);startActivity(intent);Basically splash screen waits 1 second loads a login screen, I have a register button that I would like to use to go to a register activity, now when the splash screen finishes
user2208533
javascript jquery html div onclick
I am trying to bind a click event to a div which contains a input button. What i want is when the button is clicked i want to call another function. The HTML div class is shown below.var searchAttachPoint= document.querySelector(‘.header1’);And in my javascript i have these lines.var searchAttachPoint= document.querySelector(‘.header1’); $(#header1).bind(“click”,searchPrompt(“Key the text and press Ok”, false));I am getting an error saying “Unexpected token ILLEGAL ” in the line where i bing the
koenbro
android activity onclick stop
I have a button which is supposed to open a new activity:@Overridepublic void onClick(View view) {switch (view.getId()) {case R.id.Button01:Intent myIntent = new Intent(LFSQL02.this, ManageFilms.class);startActivity(myIntent);break;}}When pressed, it leads to an unexpected stop. The manifest does list .ManageFilms class. Where is the location of the error? Thanks
Danny182
javascript php input onclick
I want to use the javascript function to clear a text input on click!but when I use it inside of php I get this error:Parse error: syntax error, unexpected ”;” onfocus=”this.select()” on’ (T_CONSTANT_ENCAPSED_STRING), expecting ‘,’ or ‘;’ in here is the code i’m using:<?php echo'<input type = “text” name = “mod_n_part” id = “mod_n_part” class=”modifica-regole-n_part” onclick=”this.value=”;” onfocus=”this.select()” onblur=”this.value=!this.value?’.$n_part.’:this.value;” value = ‘.$n_part.
Paul Mennega
android onclick
I’m having some problem here with android + java + cloud. My onCLick event is working only one timeThe event only work again when i go back to the last screen and enter again in the screen that i made searchs in the cloud…
ionutz staniu
android onclick save volume
i have an issue regardin my test App, in wich i try to create a View like in a Samsung Galaxy -> Settings -> Sound-> Volume, but instead of all Volume Controler, and the two buttons OK Cancel, i want just Ringer Volume and a Save button.I am new in android and really don’t know why my code below behave bad. public class SaveActivity extends Activity {private AudioManager aManager;private SeekBar seekVolume;private Button save;public int main_progress;@Overridepublic void onCreate(Bundle savedIns
Inherent
javascript function object copy assign
I am new to Java Script and I don’t understand, what a variable is storing, if it gets the return value of a function that is a object. My fear is, that such a variable is not storing the value, but only a link to a memory, that is maybe overwritten a little later.I tried this to find it out:This function returns a object with the content: name=”first” or name=”second”:var returnObject = function (theSecond) {var obj = { name : “first” };if (theSecond) {obj.name = ‘second’;}return obj; };2 varia
Francisco Presencia
php class variables assign
How can I assign multiple variables at once in PHP? This is basically what I’m trying to achieve but it throws a parsing error on private $from = private $to saying syntax error, unexpected ‘private’:<?php namespace Library;class Localize{// Default data for both fields. Localization must be specified.private $from = private $to = array(‘language’ => ‘en’, // Language: English’country’ => ‘usa’, // Country: USA’currency’ => ‘dollar’, // Currency: dollar $’units’ => ‘is’
steve
python methods assign
I have this method in a class:def do_exit():# some taskI want to assign a bunch of other methods to do_exit, so currently I’m doing this:do_quit = do_exit do_stop = do_exit do_finish = do_exit do_complete = do_exit do_leave = do_exitThis works fine but I’m wondering if there’s a better way, especially if I’m going to be doing this a lot.
MattDiPasquale
objective-c delegates asihttprequest retain assign
Is it OK to retain a delegate of a subclass of ASIHTTPRequest?I made a subclass of ASIHTTPRequest called JSONRequest. Each instance of JSONRequest is its own delegate, handles the callbacks, and passes them on to jsonDelegate, which is a private property of JSONRequest, and responds to requestFinished:withResult:, where result is an NSDictionary representation of the JSON response. To do this, I overloaded setDelegate: in JSONRequest to do super.delegate = self; self.jsonDelegate = newDelegate.I
mathinvalidnik
c# xml parsing assign
Do you know how I can explicitlyt assign xml content to a string ? Example :string myXml = ” <?xml version=”1.0″?> <note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don’t forget me this weekend!</body> </note> “I want to do this but with a quite bigger file.I need it because I want to use it in my Unit testing but it shows lots of errors when I am trying to paste the content between the quotes.
JaredPar
vb.net runtime assign
sir, i have no idea how the code will look, but i want it to assign a value after reading from a text file and then store it for further use even if the text file is not there, but without using any external storage like registry, disk, ram. It should store the value in itself and do like this:- dim variable1, variable2 as string if file.exists(“text.txt”)read the textstore the text in variable 1 elsevariable2 = variable1 end ifon the basis of variable1 some action on the basis of variable2 some
madth3
c++ string segmentation-fault assign
i have the indicated problem with the following code and i have no idea what it might be causing it. I searched before posting the problem, and i learned that it might be something going out of the scope like a reference to a freed memory location but i could not find it on my own. Thank you for helping me. #include<iostream> #include<string> using namespace std;class USR{ private:string name; public:void setName(string name){ this->name = name;}string getName(){return name;}};cl
Neeta
android location return assign
In my Main class I call another class to do something, and I need to return the data back to the Main class but it’s crashing for some reason on startup of the application:My Main Activity – it crashes in getLocation() something to do with returning the Location and assigning to a Point, because when I take these lines out, it works fine.public class Main extends Activity {ArrayList<Point> gpsCoordinates = new ArrayList<Point>();@Overridepublic void onCreate(Bundle savedInstanceState
Lipis
c++ pointers structure arguments assign
I am a newbie in programming and apologise in advance if my question is too silly. My c++ project is compiled as library .xll (DLL for excel), the framework code (program entry point) is coded correct and work stable. Custom functions are separate modules. // header.h typedef struct _TMDYDate {long month;long day;long year; } TMonthDayYear;the file funcs.c has a function:// funcs.c #include “header.h”__declspec(dllexport) long GetDate() {TMonthDayYear myDate;myDate.day = 1 ;myDate.month = 1;myDa
j0k
templates smarty assign
I have a smarty structure like this/ /cache /configs /libs /templates /templates/administrator /cache /administratorI want the same template structure assign to my administrator folder. I am getting error :”Fatal error: Uncaught exception ‘SmartyException’ with message ‘Unable to load template file ‘administrator/index.tpl”The Code I am using is$t = new smarty; $t->setTemplateDir(‘.’ . DS . ‘templates/administrator’ . DS)->setCompileDir(‘.’ . DS . ‘templates_c’ . DS)->setPluginsDir(SMA
Web site is in building