If I create a cookie in Javascript document.cookie = 'unseen' how do I delete it when I navigate away from this page? This is the only cookie I am creating on the page.
I am writing Javascript code using Google maps API.
map = new google.maps.Map2(document.getElementById("map_canvas"));
map.setCenter(new google.maps.LatLng(37.4419, -122.1419), 13);
The above code sets the default location of the map canvas to Palo Alto.
How can we write the script in such a way that the setCenter function automatically points to the current location of the client?
I have a fairly simple MS Access Database that contains some metadata about a bunch of documents and a hyperlink field that links to the document on our network drive.
However, when I use a SQL INSERT statement to populate the hyperlink field, the value I give it only becomes the display text, not the actual link.
How can I make the value a functional hyperlink? I'd think that the hyperlink data type would actually create hyperlinks.
I'm using Access 2002 SP3.
Is there any way to convert a PDF to Word document via code?
I'm aware of several online sites that will do it however we cannot use them due to security concerns.
Opening the PDF in Adobe, copying all of the text and pasting into Word will not work as all of the text ends up jumbled around the place.
Is there any kind of utility that might accomplish converting PDF to Word (or rtf)?
I'm trying to write a jQuery script that will find the distance to the right edge of the browser window from my css class element and then position the child submenu dropdowns to the right or left depending on the available space to the right. Also it needs to revert to the default settings on hoverout. Here is what I have so far but it's not calculating properly.
$(document).ready(function(){
$('#dnnMenu .subLevel').hover(function(){
if ($(window).width() - $('#dnnMenu .subLevel').offset().left - '540' >= '270')
{
$('#dnnMenu .subLevelRight').css('left', '270px');}
else {$('#dnnMenu .subLevelRight').css('left', '-270px');}
});
$(document).ready(function () {
function HoverOver() {
$(this).addClass('hover');
}
function HoverOut() {
$(this).removeClass('hover');
}
var config = {
sensitivity: 2,
interval: 100,
over: HoverOver,
timeout: 100,
out: HoverOut
};
$("#dnnMenu .topLevel > li.haschild").hoverIntent(config);
$(".subLevel li.haschild").hover(HoverOver, HoverOut);
});
Basically I tried to take the width of the current window, minus the distance to the left edge of the browser of the first level submenu, minus the width of both elements together which would equal 540px, to calculate the distance to the right edge of the window when the first level submenu is hovered over. if the distance to the right of my first level submenu element is less than 540px then the second level sub menu css property is changed to position to the left instead of right. I also know that it needs to revert back to default after hover out so it can recalculate the distance from other positions within the menu structure and still have those second level submenus with enough room to still display on the right of the first level. here is css for the elements in question.
#dnnMenu .subLevel{
display: none;
position: absolute;
margin: 0;
z-index: 1210;
background: #639ec8;
text-transform: none;}
#dnnMenu .subLevelRight{
position: absolute;
display: none;
left: 270px;
top: 0px;}
The site's not live yet and I tried to create a jsfiddle but it doesn't look right. Any help would be greatly appreciated!
Best Regards,
Mario
I have a callback function in my open social application which fetches remote date. This works perfect on Crome and Mozila browers but not in IE8. Following is the example for the same, help will be appriciated:
This funcation: gadgets.io.makeRequest(url, response, params) makes the callback call
and following function process the responce:
function response(obj) {
var str = obj.text;
var offerDtlPg = str.substr(0, str.length);
document.getElementById('pplOfrDetls').innerHTML = offerDtlPg;
};
Hello,
Could anyone specify what is the need and use of the Document Type Definition in HTML pages. What is the advantages of it? I searched through the Net and found the results to be little bit confusing. Please someone highlight
Resolving an xpath that includes namepsaces in Java appears to require the use of a NamespaceContext object, mapping prefixes to namespace urls and vice versa. But I can find no mechanism for getting a NamespaceContext other than implementing it myself. This seems counter-intuitive. Is there any easy way to acquire a NamespaceContext from a document, or to create one, or failing that, to forgo prefixes altogether and specify the xpath with fully qualified names?
Hi,
I have developed a signed plugin for eclipse. I have refered this document http://www.ibm.com/developerworks/opensource/library/os-eclipse-plugin-sigs/index.html
When i am installing that plugin in my system it is ok. and asking for certificate verification .But when i am installing that plugin in other system's eclipse it is giving error. Signed plugin is not getting install in other machine except mine.Why it is like that how to solve that problem please tell???
Is there any official/unofficial/informal convention for alt+key namings ? maybe, Microsoft have some internal document for that thing. Different menu levels and so on ...
http://img256.imageshack.us/img256/2426/shortcutl.jpg
Hello, I am by no means an expert at javascript, but I have been reading Dave Pilgrim's "Dive into HTML5" webpage and he mentioned something that I would like a better understanding of.
He states:
"Finally, you use the double-negative trick to force the result to a Boolean value (true or false)."
function supports_canvas() {
return !!document.createElement('canvas').getContext;
}
If anyone can explain this a little better I would appreciate it!
Hello,
Is there a good, open-source, document CMake module for gettext support?
I mean:
Extracting messages from sources
Merging messages to existing translations
Compilation of mo-files
Installation of mo-files.
Because plain macros that CMake provides are quite... useless for real l10n support.
Hi!
I'm working in a website were we update the content of a div using Jquery.
Inside the content we use to update the div there are some buttons with jquery actions attached.
The first time the document is loaded lightbox is OK, but after the div content is updated the jquery lightbox doesnt works.
Any comments welcome ;)
I have a recursive function reading a "table of contents" of documents from a database.
I would like to print numbering with the document that reflects where the item is in the tree, e.g.
First item,
1.1 Child of first item,
1.1.1 Child of child of first item,
1.2 Child of first item,
Second item,
2.1 Child of second item,
etc.
Rather stumped about this at the moment - help please?
I'm writing a Chrome extension that uses a content script to modify certain parts of a website. The content script worked fine until I tried to add an options page to my extension.
Right now I'm using an options.html file to save user preferences to localstorage, as you can see here:
<html>
<head><title>Options</title></head>
<script type="text/javascript">
function save_options() {
var select = document.getElementById("width");
var width = select.children[select.selectedIndex].value;
localStorage["site_width"] = width;
}
function restore_options() {
var fwidth = localStorage["site_width"];
if (!fwidth) {
return;
}
var select = document.getElementById("width");
for (var i = 0; i < select.children.length; i++) {
var child = select.children[i];
if (child.value == fwidth) {
child.selected = "true";
break;
}
}
}
</script>
<body onload="restore_options()">
Width:
<select id="width">
<option value="100%">100%</option>
<option value="90%">90%</option>
<option value="80%">80%</option>
<option value="70%">70%</option>
</select>
<br>
<button onclick="save_options()">Save</button>
</body>
</html>
I also have a background.html file to handle the communication between the content script and the localstorage:
<html>
<script type="text/javascript">
chrome.extension.onRequest.addListener(function(request, sender, sendResponse) {
if (request.method == "siteWidth")
sendResponse({status: localStorage["site_width"]});
else
sendResponse({});
});
</script>
</html>
Then there's the actual content script that looks like this:
var Width;
chrome.extension.sendRequest({method: "siteWidth"}, function(response) {
width = response.status;
});
None of that code actually works. It looks solid enough to me but I'm not a very experienced programmer so I might be wrong.
Could someone explain localstorage to me in layman's terms?
There is a server changing a batch to add up data on the date and time, but I want to send the end states (normal end or abnormal termination) of this batch to Yahoo! Messenger or one's ID of the MSN messenger as a message, but a page and the document which I am useful for are not found.
Can I send alert message to MSN messenger or Yahoo! messenger from servers?
I want detailed explanations for bsd-socket options so that I can use them in the right manner. Can anybody please provide me some document or link from where I can refer?
Thanks,
Satinder Singh
[email protected]
i have a div id=holder, and inside a coda slider. it works alright, but to avoid the flickering in certain browsers, i decided to make holder display:none, and then display:block on $(document).ready
The problem is that, for some reason, when the parent div is display:none, the coda slider doesnt have any effect.
any workarounds or ideas for this issue? thanks!
Now one Submit button is the default focused control. but I need to set the default focus to another imagebutton. Can only use $(document).ready(function(){ctrl.focus();} ? or has another property to fulfill it?
If the submit button is clicked, prevent the default action and see if the field 'account_name' is already in use. If the $.get() returns a result, alert the user of the results. If it doesn't, submit form with id="add_account_form".
My problem is that my else{} statement is not submitting the form. I get no response when submit is clicked & there is no value returned.
Also I would like to change my code where it goes $("#add_account_form").submit(..) instead of .click() however, would that cause a problem when trying to submit the form later in the script?
<script type="text/javascript">
$(document).ready( function () {
$("#submit").click( function () {
var account_name = $("input[name=account_name]").val();
$.get(
"'.url::site("ajax/check_account_name").'",
{account_name: account_name},
function(data){
if(data.length > 0){
confirm( "The account name you entered looks like the following:\n"
+data+
"Press cancel if this account already exists or ok to create it."
);
}else{
$("#add_account_form").submit();
}
});
return false;
});
});
</script>
<p>
<input type="submit" id="submit" class="submit small" name="submit" value="Submit" />
</p>
</form>
Thanks for your help.
EDIT
So anyone who runs into my problems, it's that $.get() is asynchronous, so it will always return false, or true depending on what submitForm is defined as. $.ajax() however, allows async to be set as false, which allows the function to finish before moving on. See what I mean:
$(document).ready( function () {
$("#add_account_form").submit( function () {
var submitForm = true;
var account_name = $("input[name=account_name]").val();
$.ajax({
type: "GET",
async: false,
url: "'.url::site("ajax/check_account_name").'",
data: ({account_name: account_name}),
success:
function(data){
if(data.length > 0){
if(!confirm( "The account name you entered looks like the following:\n"
+data+
"Press cancel if this account already exists or ok to create it."
)){
submitForm = false;
}
}
}
});
if (submitForm == false ) {
return false;
}
});
});
Thanks for your help @Dan
I have an XML file located at a location such as
http://example.com/test.xml
I'm trying to parse the XML file to use it in my program with xPath like this but it is not working.
Document doc = builder.parse(new File(url));
How can I get the XML file?
Is there a way to create a section on a menu for a list of menu items to be populated by something like an ObservableCollection?
I'd like to replicate the Window functionality in Visual Studio, where the open document tabs are listed in a numbered list, limited to the first 10.