My Blog List

Thursday, October 23, 2014

this article is about ajax and and using proxy server with apache httpd

I wanted to try get ajax data from other site..
and Chorme and WebBrowser told me that cross domain security so I can't access
this url...
there is good solution when you develope different site and test it




changed apache conf.htttp ~!!!


LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so

ProxyRequests Off
<Proxy *>
            Order deny,allow
                Allow from all
                SetEnv force-proxy-request-1.0 1
                SetEnv proxy-nokeepalive 1
                SetEnv proxy-initial-not-pooled 1

</Proxy>

ProxyPass /neo http://192.168.123.171:8080/neo
ProxyPassReverse /neo http://192.168.123.171:8080/neo

Wednesday, October 22, 2014

Jquery extend function

This is somehow good when extend data and overwrite

var object1 = {
apple: 0,
banana: { weight: 52, price: 100 },
cherry: 97
};
var object2 = {
banana: { price: 200 },
durian: 100
};
// Merge object2 into object1
$.extend( object1, object2 ); object1 data {"apple":0,"banana":{"price":200},"cherry":97,"durian":100}

Thursday, October 16, 2014

maintaining position in list when history back

Recently I was ordered that I have to change paging list way to infinite list, that mean I have to query with special key, not page number.

I have to think seriously, can I do this???

I searched other homepages if there are hompages that use this pattern.
Best homepage was Facebook to benchmark

Facebook show us topic in timeline and if scroll to bottom , ajax will get more data from the server.

but there are something that i should consider carefully. 
what is that???

for example, i choose one topic and go backpage, list page will refresh and position I last saw will be lost.
In other word, ajax loading data dosen't save homepage last state.

To solve this problem.
I Think step.

1. in my list page, call list data from the server using ajax.
2. I scroll some position.
3. I click some data.
  - I have to check scroll.x scroll.y and save in history.
4. detail page show
5. go back to list page
6. get the last scrollx, scroll.y from saved data 
   - ajax call againg
7. and scroll to last position.

this is what I think
I might be good to change what I'm now working on.

Test Script
1. History.js
2. Iscroll4 

Monday, October 13, 2014

Element ready after appending data.

In jquery, there I can catch callback when data is fully loaded .

I wanted to knwo maybe in angularjs has too.
I searched much time and find out how to use
below is just example.


angular.element(document.querySelector('#contentBox')).append(data).ready(function(){
//                alert('ready complete');
         $scope.loaded();

});


and 

angular.element i can use jquery lite 
reference by 

Sunday, October 5, 2014

angular ng-if

how can I check if data is over number or like when in jstl
there i can use ng-if

for example .


referenced by https://code.angularjs.org/1.1.5/docs/api/ng.directive:ngIf

  1. <span ng-if="checked" ng-animate="'example'">
  2. I'm removed when the checkbox is unchecked.
  3. </span>