Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Special Interests > Visual Media > Web Design and Development

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old Nov 14, 2012, 02:28 PM   #1
naqviak
macrumors newbie
 
Join Date: Nov 2012
Javascript behaves different with IOS6

Hi

I have an iPad app in store called Mygazine Daily. The app is showing strange behavior in IOS6. The issue is narrowed down to this


I am not getting proper results when a execute a javascript in UIWebView using stringByEvaluatingJavaScriptFromString


Here is the string that works with IOS5


Quote:
NSString *scriptString = @" function paging(){ var div1 = document.getElementById('page1').style; div1.height = window.innerHeight + 'px !important'; var columnWidth = window.innerWidth - 100; div1.webkitColumnWidth = columnWidth +'px !important'; div1.webkitColumnGap = '0px'; window.scroll(1000000,0); var result = window.pageXOffset/window.innerWidth + 1; return Math.ceil(result);} paging();";


Here is what my desired function is

Code:
function paging(){
var div1 = document.getElementById('page1').style; 
div1.height = window.innerHeight  + 'px !important';
var columnWidth = window.innerWidth - 100;
div1.webkitColumnWidth = columnWidth +'px !important';
div1.webkitColumnGap = '0px';
window.scroll(1000000,0);
var result = window.pageXOffset/window.innerWidth + 1;
return Math.ceil(result);}
paging();";
I have added alert() under different locations and this is what I found -
alert(div1.height) returns 840px under IOS5.1 but nothing under IOS6



Please help me understand what is different in IOS6

Last edited by dejo; Nov 14, 2012 at 02:47 PM. Reason: Please use [code] tags.
naqviak is offline   0 Reply With Quote

 
MacRumors Forums > Special Interests > Visual Media > Web Design and Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
iPhone 4S Behaves oddly after water damage zxoraz iPhone Tips, Help and Troubleshooting 1 Sep 24, 2013 06:27 AM
iPhone: Restore SMS Database from iOS6.1.2 to iOS6.0.2 HeyGreggie Jailbreaks and iOS Hacks 12 Apr 8, 2013 11:40 AM
Keychain behaves strangely VTR Mac Basics and Help 1 Feb 20, 2013 11:48 AM
transition from iOS6 beta 4 to iOS6 on Sep 21st ???? Krissypantz2828 iOS 6 18 Sep 13, 2012 04:25 AM
Mac app store behaves differently when on Ethernet than on wifi hassoon Mac Basics and Help 0 Aug 1, 2012 05:00 AM

Forum Jump

All times are GMT -5. The time now is 03:25 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC