Posts

javascript - How do I put this jQuery code in an external .js file? -

i have jquery code works fine when placed between <body> , </body> tags of .html file. i want use javascript external javascript instead of internal. bit works if place javascript @ end before </body> tag. if place javascript within <head></head> not working also. so need getting javascript code run externally. how modify code when place in external .js file? and how call code onload? html <html> <head> <style> .blue1 {background: green;} .red {background: red;} .orange {background: orange;} .yellow {background: yellow;} </style> </head> <body> <table border="2px solid black">/*border*/ <tr> <td colspan="1"> <p class="hello_blue1">hello stack overflow1</p> </td> <td rowspan="1" colspan="2"> <p class="tab-text-7-aufz_red">hello stack overflow2</p...

JQuery Passing Array string -

i'm trying pass array .each jquery code, passing numbers 0, 1, 2, 3,... instead of string values. my code define variable is: var accessoriescats = [ 'beaded accessories', 'cufflinks', 'flip flops', 'floral accessories', 'foot jewelry', 'hair accessories', 'hankies', 'jewelry', 'leg garters', 'purses', 'shoe stickers', 'something blue', 'tiaras', 'totes' ]; here entire code: <script> if (window.location.href.indexof("category-s/2022.htm") != -1) { var accessoriescats = [ 'beaded accessories', 'cufflinks', 'flip flops', 'floral accessories', 'foot jewelry', 'hair accessories', 'hankies', 'jewelry', 'leg garters', 'purses', 'shoe stickers', 'something blue', 'tiaras', 'totes' ]; $('#content_area ...

php - pass parameters in URL code igniter -

i new ci , try pass information login page following... public function authenticate() { $this->load->model('user_model', '', true); if ($this->user_model->authenticate($this->input->post('username'), $this->input->post('password'))) { $this->session->set_userdata('loggedin', true); header('location: /'); } else { header('location: /sessions/login/error?='.'1'); } } and on login page use _get. so how best go in codeigniter? first of all, using sensitive data email/password general no-no. bad practice way. but answer question here - http://www.codeigniter.com/userguide3/libraries/input.html $this->input->get('username') equal $_get['username'] . might use $this->input->get('username', true) escape malicious code. and $this->input->post('username') equal $_post[...

uinavigationcontroller - iOS 8 - Set Status Bar Color (when your UINavigationBar has a nil backgroud image) -

Image
i using view pager in app (specifically icviewpager). make view pager blend navigation bar so: i had put these lines of code in appdelegate.m [[uinavigationbar appearance] setbackgroundimage:[[uiimage alloc] init] forbarmetrics:uibarmetricsdefault]; [[uinavigationbar appearance] setshadowimage:[[uiimage alloc] init]]; however, causes status bar not same color navigation bar. how set color of status bar same navigation bar? how set color of status bar same navigation bar? you don't. status bar has no color . transparent. job make view has desired color extend top of view, behind status bar, that color shows through. this view window, example, or view controller's main view. right now, white, , see white color show through above top of navigation bar. if give window (or main view, or whatever white thing seeing) same color navigation bar, you'll effect want. alternatively, adjust size , position of navigation bar reaches top of window , cover...

android - Updating custom card expand UI in cardslib? -

this isn't issue, it's more of question. wanted know when create card custom expand , put card in cardslist. when setupinnerviewelements() called? called when expand card or called when touch card or scroll list? and if update ui of card expand @ runtime while expanded how suggest doing ? suppose have button prompts user enter string , want append string existing string in cardexpand? , @ same time make string available other other cards in expand views ? there method override achieve ? im sorry cant provide code because long , tedious piece of code. thanks the setupinnerviewelements() in adapter, called standard getview() method inside adapter. it called when list scrolls, or when update adapter example (when expand/collapse card, update adapter). currently can't use different layout cards in adapter. hovewer can set values inside card (model) enable/disable elements in ui (in s etupinnerviewelements ). if update runtime ui, have update values in...

logging - Worklight 6.2 - Server side WL.Logger -

i'm trying configure server logs on worklight runtime environment 6.2 (deployed on 8.5) is possible configure , format wl.logger output on server side in order to: log on differtent file standard output use conversion pattern layout (similar log4j one): e.g. [%d{yyyy-mm-dd hh:mm:ss,sss}], %p, %c, %m%n specify rolling behavior (size, filename format, ...) alternatively, possible use log4j? how? see here using different files log output. short answer: not worklight controls. log4j replaced standard logging mechanisms provided websphere.

java - How to use websocket with Restlet framework? -

we have web server written in restlet framework, want implement websocket replace long polling design cause performance issue. checked restlet's forum , document, looks websocket no support yet , not in schedule.and don't want replace restlet other frame work since big change, comes out design proposals, , not sure 1 best: start jetty server, , use jetty's websocket lib handle websocket connection; prons:no need self develop websocket lib base on restlet; cons: need have 2 server listening on different ports. develop our own websocket lib based on restlet: prons: no need start second server; cons: big development effort. we still investigating, appreciate sharing , valuable comments, thanks!! websockets not supported yet in restlet framework, there issue opened : https://github.com/restlet/restlet-framework-java/issues/893