If you want to check whether a browser has HTML 5 geolocation support enabled and display a warning message to the user if it is not, then this function should help you out.
$('#map_canvasâ€™).text('Your browser does not support HTML 5 geolocation. ');
In this example I check to see if the navigator.geolocation method is available. If not then I use a jQuery command to update the div that would normally house the Google Map by adding warning text for the user.
Next we must download the Cycle plugin and include it from your computer.
Next step is to define your slideshow files in HTML. Simply write your img tags into a slideshow div tag.
fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
I've been having the problem of trying to output generated HTML into a ruby view template in a similar fashion to this:
<%= generated_html %>
The problem is in Rails 3 you no longer need the "h" function which escapes HTML. This is now done automatically.
The solution is to tell rails that this is safe HTML and you want to unescape the output using the "html_safe" function as follows:
<%= generated_html.html_safe %>
I have recently reinstalled Ruby on Rails 3.0.0 and created a new Rails project in NetBeans 9.6.1
I could not migrate my database, or any other rake tasks for that matter. I kept getting the error: "db:migrate" task does not exist
The solution is to right click your project select "Run/Debug Rake Task" and then click the button titled "Refresh Tasks".
Once this is done you should see a list of all your rake tasks. After this you can simply re-run the db:migrate task and it will work.
If you are having the problem that the PHP Installer MSI is not asking for your web server type and therefore not updating your server configuration or not installing the correct libs such as "php5apache2_2.dll" then you are probably using the wrong MSI.
All of the MSI installers are on the http://windows.php.net/download/ page. You do not want to use the VC9 installers. You need to use the VC6 x86 Thread Safe installer. This is usually the last option, per version.
The link to the latest safe MSI is here: PHP 5.3 VC6 Thread Safe MSI
I recently upgraded my PHP version to 5.3 and afterwards could not connect to MySQL. I was getting the following error in my PHP error log: PHP Warning: mysql_connect():  A connection attempt failed because the connected party did not (trying to connect via tcp://localhost:3306)
The solution is to do with Windows enabling IPv6 support while MySQL does not support this yet. 'localhost' is being converted to ::1 instead of 127.0.0.1, the solution to this is simple.
Go the the following directory: C:\Windows\System32\drivers\etc
Allow yourself full access to the hosts file by right clicking it and clicking properties.
Next go to the security tab and click the big "Edit" button.
Click on the "Users" group. Below this check the "Full Control" box and then save the changes.
Now that you have access to the file, open the hosts file with a text editor such as notepad.
Comment out the ::1 line with a # so the file will look something like:
# Copyright (c) 1993-2006 Microsoft Corp.
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
# For example:
# 188.8.131.52 rhino.acme.com # source server
# 184.108.40.206 x.acme.com # x client host
Once you are done, save the file and try to access your PHP page again that is using MySQL. It should work immedietley.
<input onclick="this.select();" type="text" name="title" value="Title...">
I have recently been playing with mod_rewriting my web application URLs. I find that they worked perfectly on my live host but just wouldn't work on localhost.
This solution works for me: You have to open the httpd.conf Apache configuration file.
Locate this line and remove the "#":
#LoadModule rewrite_module modules/mod_rewrite.so
Finally search the file for "AllowOverride None".
This phrase will appear 7 times in the file, you want the second one and change the "None" to "All".
The comment above the line is:
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit