SEO in combination with FOUT, new CSS features and `display: none`
I like to use new features in the W3C standard, such as transitions.
Because I believe the web is changing faster if I (and others) are willing
to use those features with the minimal fallbacks.
I'm using for example the transition property for a slider, in combination
with the display and margin properties. I remember reading on several
sites that crawlers detect hidden content. Since the content will become
dynamically visible at some point, I was wondering if it will be indexed
and if it will not affect my ranking.
The same applies to the FOUT-fix (Flash Of Unstyled Text), the visibility
property of particulair text will be set to none as soon as the rendering
of the webpage starts. When to fonts are loaded the text will become
visible.
I hope someone can give my some knowledge or advise!
Thanks in advance.
Borchelt
Thursday, 3 October 2013
Wednesday, 2 October 2013
PHP Check If column filled
PHP Check If column filled
example I have table with column like this :
L1 | L2 | L3 | L4 | L5
2 | | 1 | |
I want, if 1 of the 5 columns filled with value then will do something.
In PHP code so far :
<?php
//query to get all value of column
while ($data = oci_fetch_array($//query))
{
$l1 = $data['L1'];
$l2 = $data['L2'];
$l3 = $data['L3'];
$l4 = $data['L4'];
$l5 = $data['L5'];
}
//How can I check if 1 of the 5 column filled ?
if(bla bla)
{
}
example I have table with column like this :
L1 | L2 | L3 | L4 | L5
2 | | 1 | |
I want, if 1 of the 5 columns filled with value then will do something.
In PHP code so far :
<?php
//query to get all value of column
while ($data = oci_fetch_array($//query))
{
$l1 = $data['L1'];
$l2 = $data['L2'];
$l3 = $data['L3'];
$l4 = $data['L4'];
$l5 = $data['L5'];
}
//How can I check if 1 of the 5 column filled ?
if(bla bla)
{
}
Hide a DIV which has no class/id
Hide a DIV which has no class/id
Is it possible to hide a div with no class/id via css, or javascript?
There is a possibility another div like this to be in the page.
<div align="center">text here</div>
Is it possible to hide a div with no class/id via css, or javascript?
There is a possibility another div like this to be in the page.
<div align="center">text here</div>
HtmlUnitDriver does not appear to be loading page
HtmlUnitDriver does not appear to be loading page
I'm trying to get HtmlUnitDriver to work in my development environment. As
a beginner, I've tried implementing the example from the following page
using the latest selenium server jar:
http://code.google.com/p/selenium/wiki/GettingStarted
Unfortunately, whenever I try to run this program, I get the following
exception:
Exception in thread "main" org.openqa.selenium.NoSuchElementException:
Unable to locate element with name: q
For documentation on this error, please visit:
http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '2.35.0', revision: 'c916b9d', time: '2013-08-12
15:42:01'
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1',
java.version: '1.6.0_16'
Driver info: driver.version: HtmlUnitDriver
at
org.openqa.selenium.htmlunit.HtmlUnitDriver.findElementByName(HtmlUnitDriver.java:853)
at org.openqa.selenium.By$ByName.findElement(By.java:292)
at
org.openqa.selenium.htmlunit.HtmlUnitDriver$5.call(HtmlUnitDriver.java:1404)
at
org.openqa.selenium.htmlunit.HtmlUnitDriver$5.call(HtmlUnitDriver.java:1)
at
org.openqa.selenium.htmlunit.HtmlUnitDriver.implicitlyWaitFor(HtmlUnitDriver.java:1094)
at
org.openqa.selenium.htmlunit.HtmlUnitDriver.findElement(HtmlUnitDriver.java:1401)
at
org.openqa.selenium.htmlunit.HtmlUnitDriver.findElement(HtmlUnitDriver.java:419)
at Justin.Main.main(Main.java:30)
I've tried modifying my code to incorporate the fixes implemented here:
HtmlUnitDriver causes problems while getting an url
I've tried getting the URL of the page using driver.getCurrentUrl() after
the call to driver.get("http://www.google.com"), but the string that is
returned is about:blank.
Similar code in this example would definitely work if I were to run it
using FirefoxDriver, but to meet requirements, I need my script to run
headless with selenium.
Any help would be greatly appreciated.
I'm trying to get HtmlUnitDriver to work in my development environment. As
a beginner, I've tried implementing the example from the following page
using the latest selenium server jar:
http://code.google.com/p/selenium/wiki/GettingStarted
Unfortunately, whenever I try to run this program, I get the following
exception:
Exception in thread "main" org.openqa.selenium.NoSuchElementException:
Unable to locate element with name: q
For documentation on this error, please visit:
http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '2.35.0', revision: 'c916b9d', time: '2013-08-12
15:42:01'
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1',
java.version: '1.6.0_16'
Driver info: driver.version: HtmlUnitDriver
at
org.openqa.selenium.htmlunit.HtmlUnitDriver.findElementByName(HtmlUnitDriver.java:853)
at org.openqa.selenium.By$ByName.findElement(By.java:292)
at
org.openqa.selenium.htmlunit.HtmlUnitDriver$5.call(HtmlUnitDriver.java:1404)
at
org.openqa.selenium.htmlunit.HtmlUnitDriver$5.call(HtmlUnitDriver.java:1)
at
org.openqa.selenium.htmlunit.HtmlUnitDriver.implicitlyWaitFor(HtmlUnitDriver.java:1094)
at
org.openqa.selenium.htmlunit.HtmlUnitDriver.findElement(HtmlUnitDriver.java:1401)
at
org.openqa.selenium.htmlunit.HtmlUnitDriver.findElement(HtmlUnitDriver.java:419)
at Justin.Main.main(Main.java:30)
I've tried modifying my code to incorporate the fixes implemented here:
HtmlUnitDriver causes problems while getting an url
I've tried getting the URL of the page using driver.getCurrentUrl() after
the call to driver.get("http://www.google.com"), but the string that is
returned is about:blank.
Similar code in this example would definitely work if I were to run it
using FirefoxDriver, but to meet requirements, I need my script to run
headless with selenium.
Any help would be greatly appreciated.
Why is javascript quitting after jquery remove() statement?
Why is javascript quitting after jquery remove() statement?
Currently working with Javascript and JQuery (both which I'm new to so go
easy on me) and the goal is to, when the form is filled out incorrectly.
To add add a message that says the form is incorrect. When the form is
inputed correctly, then the "incorrect" message should be removed.
However, after inputed a bad input to prompt the additional HTML, when I
correct the form to get rid of it, the javascript terminates after the
remove function.
Also, is there anyway to remove on condition? In other words, is there a
pre-existing method that says, "if the html exists to remove, then remove,
else do nothing." or do I have to write my own flag.
$(document).ready(function ()
{
$('#basic').on('submit', function(e)
{
if(!isBasicInfoValid())
{
if(!error)
{
$('#basic').append($("<div class='basicError'>Input is
not valid! </div>"));
}
error=true;
}
else if(error)
{
error=false;
$('#basic').remove($(".basicError"));
//program is stopping after remove for some reason
scenarioCount=scenarioCount+1;
}
e.preventDefault();
});
};
<body>
<div class='form'>
<h3> Basic Information </h3>
<form id='basic'>
<div>Year of Birth: <input type='number' name='YOB'> </div>
<div>Current Savings: <input type='number' name='CurrSav'>
</div>
<div>Expected Retirement Age: <input type='number'
name='RetAge'></div>
<div>Life expectancy: <input type='number' name='LifeExp'>
</div>
<div><input type='submit' value='Submit'></div>
</form>
</div>
<div class='form'>
<h3> Scenario </h3>
<form id='scenario'>
<div>Name: <input type='text' name='ScenarioName'> </div>
<div>Rate of Investment Return (While Working): <input
type='number' name='Working'></div>
<div>Rate of Investment Return (Retired): <input
type='number' name='Retired'></div>
<div>Desired Retirement Yearly Income: <input
type='number' name='desiredInc'></div>
<div><input type='submit' value='Submit'></div>
</form>
<div><button id='add' type='submit'>Add Scenario </button></div>
</div>
</body>
Currently working with Javascript and JQuery (both which I'm new to so go
easy on me) and the goal is to, when the form is filled out incorrectly.
To add add a message that says the form is incorrect. When the form is
inputed correctly, then the "incorrect" message should be removed.
However, after inputed a bad input to prompt the additional HTML, when I
correct the form to get rid of it, the javascript terminates after the
remove function.
Also, is there anyway to remove on condition? In other words, is there a
pre-existing method that says, "if the html exists to remove, then remove,
else do nothing." or do I have to write my own flag.
$(document).ready(function ()
{
$('#basic').on('submit', function(e)
{
if(!isBasicInfoValid())
{
if(!error)
{
$('#basic').append($("<div class='basicError'>Input is
not valid! </div>"));
}
error=true;
}
else if(error)
{
error=false;
$('#basic').remove($(".basicError"));
//program is stopping after remove for some reason
scenarioCount=scenarioCount+1;
}
e.preventDefault();
});
};
<body>
<div class='form'>
<h3> Basic Information </h3>
<form id='basic'>
<div>Year of Birth: <input type='number' name='YOB'> </div>
<div>Current Savings: <input type='number' name='CurrSav'>
</div>
<div>Expected Retirement Age: <input type='number'
name='RetAge'></div>
<div>Life expectancy: <input type='number' name='LifeExp'>
</div>
<div><input type='submit' value='Submit'></div>
</form>
</div>
<div class='form'>
<h3> Scenario </h3>
<form id='scenario'>
<div>Name: <input type='text' name='ScenarioName'> </div>
<div>Rate of Investment Return (While Working): <input
type='number' name='Working'></div>
<div>Rate of Investment Return (Retired): <input
type='number' name='Retired'></div>
<div>Desired Retirement Yearly Income: <input
type='number' name='desiredInc'></div>
<div><input type='submit' value='Submit'></div>
</form>
<div><button id='add' type='submit'>Add Scenario </button></div>
</div>
</body>
Tuesday, 1 October 2013
ClientToScreen() is causing mysterious problems, and I cannot figure out why
ClientToScreen() is causing mysterious problems, and I cannot figure out why
case WM_LBUTTONDOWN:
initPos.x = LOWORD(lParam);
initPos.y = HIWORD(lParam);
break;
case WM_MOUSEMOVE:
{
POINT realPos;
RECT clientRect;
int rSect = 0;
GetClientRect(hWnd, &clientRect);
realPos.x = (int)(short) LOWORD(lParam);
realPos.y = (int)(short) HIWORD(lParam);
ClientToScreen(hWnd, reinterpret_cast<POINT*>(&clientRect.left));
ClientToScreen(hWnd, reinterpret_cast<POINT*>(&clientRect.right));
if(wParam == MK_LBUTTON)
{
if(!rSect)
{
MoveWindow(hWnd, clientRect.left + (realPos.x -
initPos.x), clientRect.top + (realPos.y - initPos.y),
width, height, TRUE);
}
}
break;
}
This is a basic snippet of my program that allows my custom window to be
dragged around the screen. It works perfect, and I am content with it.
But when I innocently tried to convert realPos and initPos coordinates to
screen positions, the window started glitching out every time I dragged
it, source code here:
case WM_LBUTTONDOWN:
initPos.x = LOWORD(lParam);
initPos.y = HIWORD(lParam);
break;
case WM_MOUSEMOVE:
{
POINT realPos;
RECT clientRect;
int rSect = 0;
GetClientRect(hWnd, &clientRect);
realPos.x = (int)(short) LOWORD(lParam);
realPos.y = (int)(short) HIWORD(lParam);
ClientToScreen(hWnd, reinterpret_cast<POINT*>(&clientRect.left));
ClientToScreen(hWnd, reinterpret_cast<POINT*>(&clientRect.right));
ClientToScreen(hWnd, &realPos);
ClientToScreen(hWnd, &initPos);
if(wParam == MK_LBUTTON)
{
if(!rSect)
{
MoveWindow(hWnd, clientRect.left + (realPos.x -
initPos.x), clientRect.top + (realPos.y - initPos.y),
width, height, TRUE);
}
}
break;
}
The initPos and realPos should be relative to eachother, as long as they
are both relative to the same grid, whether it be a client area or the
screen in general. Can anybody tell me why this, then, isn't working? I
feel like I'm missing something blatantly obvious...
case WM_LBUTTONDOWN:
initPos.x = LOWORD(lParam);
initPos.y = HIWORD(lParam);
break;
case WM_MOUSEMOVE:
{
POINT realPos;
RECT clientRect;
int rSect = 0;
GetClientRect(hWnd, &clientRect);
realPos.x = (int)(short) LOWORD(lParam);
realPos.y = (int)(short) HIWORD(lParam);
ClientToScreen(hWnd, reinterpret_cast<POINT*>(&clientRect.left));
ClientToScreen(hWnd, reinterpret_cast<POINT*>(&clientRect.right));
if(wParam == MK_LBUTTON)
{
if(!rSect)
{
MoveWindow(hWnd, clientRect.left + (realPos.x -
initPos.x), clientRect.top + (realPos.y - initPos.y),
width, height, TRUE);
}
}
break;
}
This is a basic snippet of my program that allows my custom window to be
dragged around the screen. It works perfect, and I am content with it.
But when I innocently tried to convert realPos and initPos coordinates to
screen positions, the window started glitching out every time I dragged
it, source code here:
case WM_LBUTTONDOWN:
initPos.x = LOWORD(lParam);
initPos.y = HIWORD(lParam);
break;
case WM_MOUSEMOVE:
{
POINT realPos;
RECT clientRect;
int rSect = 0;
GetClientRect(hWnd, &clientRect);
realPos.x = (int)(short) LOWORD(lParam);
realPos.y = (int)(short) HIWORD(lParam);
ClientToScreen(hWnd, reinterpret_cast<POINT*>(&clientRect.left));
ClientToScreen(hWnd, reinterpret_cast<POINT*>(&clientRect.right));
ClientToScreen(hWnd, &realPos);
ClientToScreen(hWnd, &initPos);
if(wParam == MK_LBUTTON)
{
if(!rSect)
{
MoveWindow(hWnd, clientRect.left + (realPos.x -
initPos.x), clientRect.top + (realPos.y - initPos.y),
width, height, TRUE);
}
}
break;
}
The initPos and realPos should be relative to eachother, as long as they
are both relative to the same grid, whether it be a client area or the
screen in general. Can anybody tell me why this, then, isn't working? I
feel like I'm missing something blatantly obvious...
Count attributes of Json object
Count attributes of Json object
My question is short and concise.
I need count the attributes of Json object, for example
obj={
name:'Jhon',
age:25
}
This must return 2, one for 'name' and ohter for 'age'. I try use.
obj.count();
obj.length();
But nothing...
The all solutions that I found in internet was for count elements of array.
Thanks to all!
My question is short and concise.
I need count the attributes of Json object, for example
obj={
name:'Jhon',
age:25
}
This must return 2, one for 'name' and ohter for 'age'. I try use.
obj.count();
obj.length();
But nothing...
The all solutions that I found in internet was for count elements of array.
Thanks to all!
Subscribe to:
Comments (Atom)