Jump to content

[dx]

Members
  • Posts

    719
  • Joined

  • Last visited

Posts posted by [dx]

  1. Hi,

     

    How to store data to array but key based on variable so like:

     

    var x = 'key';

    data[x] = 'value';

     

    If I do console.log(data), I see "x" instead of "key".

     

    I need store multidimensional array in format:

     

    data

    ---- key

    -------- subkey1

    ------------ { s1: 'aa', s2: 'bb', s3: 'cc' }

    ------------ { s4: 'dd', s5: 'ee', s6: 'ff' }

    -------- subkey2

    ------------ { s7: 'gg', s8: 'hh', s9: 'ii' }

    ------------ { s10: 'jj', s11: 'kk', s12: 'll' }

     

     

  2. Nah :D

     

    We have Page A which is requesting and Page B which is handled with node server. It's only .html file.

     

    So if I open Page B from http://host:post (direct link), it works fine. Also if I add http://host:port/?user=username_here everything is fine, Page B catch from url and works as it need.

     

    But if I on Page A use echo get_file_contents('page_B_URL/?user=username'); nothing is happend.

     

    Actually, I get html elements, but can't open rest of protocol which is based on this "user".

     

    I guess that is error. Missing parameter.

     

    Also, if I go to http://host:port without arguments, it uses "undefined" as "user", it's weird.

  3. Hi,

     

    I have started process with nodejs on some http://host:port

     

    Basicly if I use http://host:port/?user=something, everything works as it should.

     

    Point is that i need somehow include that part of page (from url, avoiding iframe) in another (thinking about get_file_contents) but my problem are those arguments.

     

    I read about $context parameter, so can I send data with POST method instead of GET in link above using stream_context_create() and catch it in nodejs part (which logicaly works with javascript) and then work what I want.

     

    Currently i use location.search and extract data which I need.

     

    What do you suggest?

     

    Regards

  4. Hi,

     

    I need onload event for iPad/iPhone/iPod.

     

    Tried:

    $(window).load();<body onload="func()">window.onload = function() { }

    Even tried:

     

    var checkLoad = function() {  if (document.readyState == 'complete') {    //loaded  } else {  setTimeout(function() {    checkLoad();  }, 11);}checkLoad();
    Nothing works, but only last solution sometimes retuns "complete" and sometimes "interactive".
    Regards
  5. Hi, I need quick script which will disable my vertical scrolling.I don't want it to hide with overflow, just disable, but it will be shown as before. I've tried with

    $(window).scroll(function() { 	$(window).scrollTop(lock_top);});

    And lock_top is defined before with click event. So this scrolls page with about 100px, and then jups to lock_top value. I've tried also event.preventDefault() but unsuccessfull. Best regards

  6. Hi, I'm trying to get new width and height when orientation is changed on iPad. So, I'm usinng this function:

    var ratio = 1; var orientationChanged = function() { 	if (window.orientation == 0 || window.orientation == 180) {			return {					browser_width: screen.width,					browser_height: (ratio == 1 ? window.innerHeight : (screen.width / ratio))			}	}	else if (window.orientation == 90 || window.orientation == -90) {			return {					browser_width: screen.height,					browser_height: (ratio == 1 ? window.innerHeight : (screen.height * ratio))			}	}} var dimensions = orientationChanged(); if (!dimensions) {	var dimensions = {			browser_width: window.innerWidth,			browser_height: window.innerHeight	}} ratio = (dimensions.browser_width / dimensions.browser_height);

    $(window).bind('orientationchange', function() { 	dimensions = orientationChanged(); 		.		.		.});

    Also, I'm using this meta tag:

    <meta name="viewport" content="height=device-height, width=device-width, initial-scale=1, maximum-scale=1" />

    Problem is that I get correct values but when I try set with .css() or .width() it sets another value. I guess it sets good value, but problem lies in scale. I checked width after setting and it's good. So I need some advice.. Best regards..

  7. Yes, I just thought on it and came here for solution. I want create new window, resize and move to right border of screen. That's easy part of story, but how to resize current window? I've tried this.window , window , parent.. Neither of them don't work.

  8. Hello, I need to have two parts of web page. On one side is my web and on other side is chat. So I need to make my chat stays on page and not reload even if users click on links on web. I have done it with iframes before, two iframes which calls files, and works fine, but iframe takes too long to load page. So I need something quicker but in same functional. What do you suggest?

  9. Hello, I have code which calls function which slows for a while becouse it uses mysql_connect() to remote server etc. I wan't to avoid waiting for response, and just continue with rest of code no matter what happens with function.. Waiting causes my script to do EMPTY_RESPONSE in chrome. Best regards

×
×
  • Create New...