Posts

Featured post

javascript - Play sound in jquery mobile on different pages -

i need play sound in background repeat time - background music. have added <audio> tag in page html , added event $("#audio-player").on('ended', function() { //play again } in pageinit event of page. , works, music should continue when navigate other page, , not sure how make this. appreciate help. you use ajax load new page. use jquery's load() load #content part of new page #content div of current page. html <header> <audio controls> <source src="horse.ogg" type="audio/ogg"> </audio> </header> <a href="page2.html">page 2</a> <div id="content"> page 1 content </div> </body> </html> javascript / jquery $('a').click(function(e){ e.preventdefault(); var target = $(this).attr('href'); $('#content').load(target + ' #content'); });

php - wordpress show unserialize data in a smart way -

in wordpress have stored data in database serialize method. have fetched data in array. code this global $wpdb; $results = wpdb->get_results("select * `table` `id` = 3"); foreach($results $result) { echo '<pre>'; print_r($result); echo '</pre>'; } this 1 getting me data this array ( [0] => stdclass object ( [id] => 1 [title] => a:3:{i:1;s:8:"test1";i:2;s:8:"test2";i:0;s:0:"test3";} [page] => a:3:{i:1;s:3:"dsa";i:2;s:4:"dsds";i:0;s:0:"sdvdsvds";} ) ) now want count values , want show values in listing. here can see have 3 values title , page. took title counter. made this foreach($results $result) { $count = count(unserialize($result->title)); // gave 3 for( $i = 0; $i<$count; $i++ ) { echo '<li></li>'; // gave me 3 li's wanted } } now

jquery - Backbone Router doesn't appear to correctly Extending Router -

Image
define([ 'jquery', 'underscore', 'backbone', 'app', 'models/sessionmodel', 'views/home/homeview', ], function( $, _, backbone, app, sessionmodel, homeview ){ approuter = backbone.router.extend({ initialize: function(options){}, routes : { '' :'showhome', }, showhome : function(){ this.show(new homeview()); }, }); return approuter; }); and here main first hit per backbone standards. have file called app created empty object , returns it... require.config({ paths: { jquery: 'libs/jquery/jquery-1.8.2', underscore: 'libs/underscore/underscore-min', backbone: 'libs/backbone/backbone-1.0.0-min', text: 'libs/require/text', router: 'router', app: 'app' }, shim: { jquery: { exports: '$' }, underscore: { exports: '_' }, backbone:

javascript - Why in IE loading image not show at center bottom of page? -

this question has answer here: how “position:fixed” css work in ie 7+ transitional doctype? 2 answers why in ie loading image not show @ center bottom of page ? this function load content on load page , load content on scroll bottom. first, load page index.php see loading image @ center bottom of page. but test on ie 7,8 loading not show @ center bottom of page , how can ? index.php <script src="http://code.jquery.com/jquery-1.7.2.js"></script> <script> // on submit form call function code // $("#f1").submit(send_requests()); </script> <body> <form method="post" id="f1"> <input type="hidden" name="something"/> </form> <div id="loading" style="padding: 0px; margin: 0px; position: fixed; bottom: 135px; right: 50%;

ios - Append ASCII symbol to the string -

i have string , ascii code in hex 0x1111 . how can append ascii code @ end/beginning of string see symbol of code? nsstring* = @"some"; the simplest way: nsstring *some = @"some"; = [[@"@\u1111" stringbyappendingstring:some] stringbyappendingstring:@"@\u1111"]; nslog(@"some: %@", some); returns: some: @ᄑsome@ᄑ

android - Set app activity to accept action.VIEW action -

when user tap on button code happen: uri web = uri.parse("http://www.google.com"); intent = new intent(intent.action_view,web); startactivity(i); and it's runs ok, open website in default web browser. trying display menu, appears if have more applications capable display web pages installed. prepared blank application fakebrowser androidmanifest file: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.pavel.fakebrowser" > <application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <activity android:name=".myactivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.main"

c# - ASP checkbox 'checked' attribute always returning true -

i have several asp:checkboxes on webform filled in on page load, returned on button submit. the buttons returning same server boolean behind them, no matter whether changed on client side before being returned. after checking clientid of variables, same not down hidden ids or that. aspx <script type="text/javascript"> function slidetable(link) { $(link).parent().next().toggle() $(link).find(".navplus").toggleclass("rotate1"); $(link).find(".navplus").toggleclass("rotate"); var txt = $(link).parent().next().is(':visible') ? 'minimise' : 'view all'; $(link).find(".navplus").text(txt); }; function boxchange(box) { //change has happened @ point if ($(box).prop("checked")==true) { $(box).attr("checked", "checked"); } else { $(box).removeattr("che