[Solved] calling a php function from a javascript script [duplicate]

[ad_1] You’ll need to call the PHP function from within the PHP page and print the result. Then connect to it with Javascript/AJAX to get the plain text the PHP prints. Example from w3schools. <script> function loadXMLDoc(){ var xmlhttp; var response; if (window.XMLHttpRequest){ xmlhttp=new XMLHttpRequest(); } xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4 && xmlhttp.status==200){ response=xmlhttp.responseXML; alert(response); } } … Read more

[Solved] target _blank funny behaviour [closed]

[ad_1] It’s an issue with this script: http://www.l2herbal.com/js/scrollTo.min.js Here is a code that changes window URL: window.location.hash = d You applied it to all menu links in http://www.l2herbal.com/js/main.js: $(‘#nav-boxes a, .logo a, #nav a, #navmobile ul a’).scrollTo({ duration: ‘slow’ }); Change #nav-boxes a selector to exclude forum url. 3 [ad_2] solved target _blank funny behaviour … Read more

[Solved] Literal converstion NSData to NSString [closed]

[ad_1] HINT#1 //general answer NSString provides an initializer for this purpose. You can see more info using the docs here. NSString * str = [[NSString alloc] initWithData: mynsdata encoding:NSUTF8StringEncoding]; Assuming you use ARC. HINT#2 // the answer for hex nsdata int len = [mynsdata length]; NSMutableString *str = [NSMutableString stringWithCapacity:len*2]; const unsigned char *nsdata_bytes = … Read more

[Solved] Confusion about interface & thread [duplicate]

[ad_1] Thread constructor is like Thread t = new Thread(Runnable runn) and not (new Runnable(){}). When we do something as shown below Thread t = new Thread(new Runnable() { @Override public void run() { // TODO Auto-generated method stub } }); It’s basically asking us to implements run method as defined in Runnable inteface. Alternatively … Read more

[Solved] Developing android apps [closed]

[ad_1] You would need a good understanding of Android fundamentals, XML layouts and SQLite db. Android training is a great place to start. A good sample app to start with all the DB stuffs comes with the SDK installation. Path is: \samples\android-17\NotePad 6 [ad_2] solved Developing android apps [closed]

[Solved] decimal of numbers in c

[ad_1] The error is that %d in the format specifier of both scanf and printf represents decimal, so it expects an int (in the case of scanf, a pointer to int) Since you are declaring b and c as float, %d in the lines scanf(“%d”,&b); printf(“%d lbs is %d kgs.”,b,c); should be changed to %f … Read more

[Solved] How to construct a button on runtime (Android) [closed]

[ad_1] you can create button from code. you can find all the alternative methods of setting attribute in the doc. for example Button button = new Button(this); button.setText(“hi”); button.setId(Id); button.setTextColor(Color.Red); button.setBackgroundResource(R.drawable.icon); buttonlayout.addView(button); 1 [ad_2] solved How to construct a button on runtime (Android) [closed]

[Solved] Improving my guessing game [closed]

[ad_1] one of 2 things could be done here either replacing the exception throwing with something else which would be something like this: inside Game.main() change this: try{ jar.guess(); } catch(IllegalArgumentException iae){ System.out.println(“Please choose a valid number”); } to this: jar.guess(); simply eliminating the try catch check and inside Jar.guess() change this: if(guess>maxNumberOfItems){ throw new … Read more